All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.linkedin.dex.spec.EncodedAnnotation.kt Maven / Gradle / Ivy

There is a newer version: 2.3.4
Show newest version
/**
 * Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
 * See LICENSE in the project root for license information.
 */
package com.linkedin.dex.spec

import java.nio.ByteBuffer

data class EncodedAnnotation(
        val typeIdx: Int,
        val size: Int,
        val elements: Array
) {
    companion object {
        fun create(byteBuffer: ByteBuffer): EncodedAnnotation {
            val typeIdx = Leb128.readUnsignedLeb128(byteBuffer)
            val size = Leb128.readUnsignedLeb128(byteBuffer)
            val elements = Array(size, { AnnotationElement(byteBuffer) })
            return EncodedAnnotation(typeIdx, size, elements)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy