DataByteArray

data class DataByteArray(val value: ByteArray = byteArrayOf()) : Parcelable

Wrapper around ByteArray. There is a problem with ByteArray when using inside data class, because it requires to generate equals() and hashCode() methods. This class do this internally so there is no need to do this again in data classes which uses DataByteArray.

Constructors

Link copied to clipboard
constructor(value: ByteArray = byteArrayOf())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val size: Int
Link copied to clipboard

Original ByteArray value.

Functions

Link copied to clipboard
Link copied to clipboard
fun copyOfRange(fromIndex: Int, toIndex: Int): DataByteArray
Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun getByte(@IntRange(from = 0) offset: Int): Byte?

Returns a byte at the given offset from the byte array.

Link copied to clipboard
fun getChunk(offset: Int, mtu: Int): DataByteArray
Link copied to clipboard
fun getFloatValue(formatType: FloatFormat, @IntRange(from = 0) offset: Int): Float?

Returns an float value from the given byte array.

Link copied to clipboard
fun getIntValue(formatType: IntFormat, @IntRange(from = 0) offset: Int): Int?

Returns an integer value from the byte array.

Link copied to clipboard
fun getLongValue(formatType: LongFormat, @IntRange(from = 0) offset: Int): Long?

Returns a long value from the byte array.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)