TWData class abstract

Defines a resizable block of data.

The implementantion of these methods should be language-specific to minimize translation overhead. For instance it should be a jbyteArray for Java and an NSData for Swift.

Constructors

TWData.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
TWDataCreateWithHexString(Pointer<Utf8> hex) Pointer<Void>
Creates a block of data from a hexadecimal string. Odd length is invalid (intended grouping to bytes is not obvious).
TWDataCreateWithSize(int size) Pointer<Void>
Creates an uninitialized block of data with the provided size.
TWDataGet(Pointer<Void> data, int index) int
Returns the byte at the provided index.
TWDataSet(Pointer<Void> data, int index, int byte) → void
Sets the byte at the provided index.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

TWDataAppendByte(Pointer<Void> data, int byte) → void
Appends a single byte.
TWDataAppendBytes(Pointer<Void> data, Pointer<Uint8> bytes, int size) → void
Appends data from a byte array.
TWDataAppendData(Pointer<Void> data, Pointer<Void> append) → void
Appends a block of data.
TWDataBytes(Pointer<Void> data) Pointer<Uint8>
Returns the raw pointer to the contents of data.
TWDataCopyBytes(Pointer<Void> data, int start, int size, Pointer<Uint8> output) → void
Copies a range of bytes into the provided buffer.
TWDataCreateWithBytes(Pointer<Uint8> bytes, int size) Pointer<Void>
Creates a block of data from a byte array.
TWDataCreateWithData(Pointer<Void> data) Pointer<Void>
Creates a block of data by copying another block of data.
TWDataDelete(Pointer<Void> data) → void
Deletes a block of data created with a TWDataCreate* method.
TWDataEqual(Pointer<Void> lhs, Pointer<Void> rhs) bool
Determines whether two data blocks are equal.
TWDataReplaceBytes(Pointer<Void> data, int start, int size, Pointer<Uint8> bytes) → void
Replaces a range of bytes with the contents of the provided buffer.
TWDataReset(Pointer<Void> data) → void
Sets all bytes to the given value.
TWDataReverse(Pointer<Void> data) → void
Reverse the bytes.
TWDataSize(Pointer<Void> data) int
Returns the size in bytes.