| Package | com.kaazing.gateway.client.html5 |
| Class | public class ByteBuffer |
| Property | Defined by | ||
|---|---|---|---|
| array : Array
The array property provides byte storage for the buffer.
| ByteBuffer | ||
| autoExpand : Boolean = true
The autoExpand property enables writing variable length data,
and is on by default.
| ByteBuffer | ||
| capacity : int = 0
The capacity property indicates the maximum number of bytes
of storage available if the buffer is not automatically expanding.
| ByteBuffer | ||
| limit : int = 0
The limit property indicates the last byte of data available for
reading.
| ByteBuffer | ||
| order : ByteOrder
The order property indicates the endianness of multibyte integer types in
the buffer.
| ByteBuffer | ||
| position : int = 0
The position property indicates the progress through the buffer,
and indicates the position within the underlying array that
subsequent data will be read from or written to.
| ByteBuffer | ||
| Method | Defined by | ||
|---|---|---|---|
|
ByteBuffer(bytes:* = null)
Creates a new ByteBuffer instance.
| ByteBuffer | ||
|
allocate(capacity:int):ByteBuffer
[static]
Allocates a new ByteBuffer instance.
| ByteBuffer | ||
|
Clears the buffer.
| ByteBuffer | ||
|
Compacts the buffer by removing leading bytes up
to the buffer position, and decrements the limit
and position values accordingly.
| ByteBuffer | ||
|
Duplicates the buffer by reusing the underlying byte
array but with independent position, limit and capacity.
| ByteBuffer | ||
|
expand(expectedRemaining:int):ByteBuffer
Expands the buffer to support the expected number of remaining bytes
after the current position.
| ByteBuffer | ||
|
expandAt(i:int, expectedRemaining:int):ByteBuffer
Expands the buffer to support the expected number of remaining bytes
at the specified index.
| ByteBuffer | ||
|
fill(size:int):ByteBuffer
Fills the buffer with a repeated number of zeros.
| ByteBuffer | ||
|
fillWith(b:int, size:int):ByteBuffer
Fills the buffer with a specific number of repeated bytes.
| ByteBuffer | ||
|
Flips the buffer.
| ByteBuffer | ||
|
get():int
Returns a single-byte number from the buffer at the current position.
| ByteBuffer | ||
|
getAt(index:int):int
Returns a single-byte number from the buffer at the specified index.
| ByteBuffer | ||
|
getByteArray(length:int):ByteArray
Returns bytes in an ByteArray
| ByteBuffer | ||
|
getByteArrayAt(index:int, length:int):ByteArray
Returns a ByteArray of length size from the buffer starting from the specified position.
| ByteBuffer | ||
|
getBytes(length:int):Array
Returns specified number of bytes in an array
| ByteBuffer | ||
|
getBytesAt(index:int, length:int):Array
Returns a byte array of length size from the buffer starting from the specified position.
| ByteBuffer | ||
|
getHexDump():String
Returns a hex dump of this buffer.
| ByteBuffer | ||
|
getInt():int
Returns a four-byte number from the buffer at the current position.
| ByteBuffer | ||
|
getIntAt(index:int):int
Returns a four-byte number from the buffer at the specified index.
| ByteBuffer | ||
|
getMediumInt():int
Returns a three-byte number from the buffer at the current position.
| ByteBuffer | ||
|
getMediumIntAt(index:int):int
Returns a three-byte number from the buffer at the specified index.
| ByteBuffer | ||
|
getPrefixedString(fieldSize:int, cs:Charset):String
Returns a length-prefixed string from the buffer at the current position.
| ByteBuffer | ||
|
getShort():int
Returns a two-byte number from the buffer at the current position.
| ByteBuffer | ||
|
getShortAt(index:int):int
Returns a two-byte number from the buffer at the specified index.
| ByteBuffer | ||
|
Returns a null-terminated string from the buffer at the current position.
| ByteBuffer | ||
|
getUnsigned():int
Returns an unsigned single-byte number from the buffer at the current position.
| ByteBuffer | ||
|
getUnsignedAt(index:int):int
Returns an unsigned single-byte number from the buffer at the specified index.
| ByteBuffer | ||
|
getUnsignedBytes(length:int):Array
Returns specified number of unsigned bytes in an array
| ByteBuffer | ||
|
getUnsignedInt():int
Returns an unsigned four-byte number from the buffer at the current position.
| ByteBuffer | ||
|
getUnsignedIntAt(index:int):int
Returns an unsigned four-byte number from the buffer at the specified index.
| ByteBuffer | ||
|
getUnsignedMediumInt():int
Returns an unsigned three-byte number from the buffer at the current position.
| ByteBuffer | ||
|
getUnsignedMediumIntAt(index:int):int
Returns an unsigned three-byte number from the buffer at the specified index.
| ByteBuffer | ||
|
getUnsignedShort():int
Returns an unsigned two-byte number from the buffer at the current position.
| ByteBuffer | ||
|
getUnsignedShortAt(index:int):int
Returns an unsigned two-byte number from the buffer at the specified index.
| ByteBuffer | ||
|
hasRemaining():Boolean
Returns true if this buffer has remaining bytes,
false otherwise.
| ByteBuffer | ||
|
indexOf(b:int):int
Returns the index of the specified byte in the buffer.
| ByteBuffer | ||
|
Marks a position in the buffer.
| ByteBuffer | ||
|
markValue():int
Returns the mark position in the buffer.
| ByteBuffer | ||
|
put(v:int):ByteBuffer
Puts a single byte number into the buffer at the current position.
| ByteBuffer | ||
|
putAt(index:int, v:int):ByteBuffer
Puts a single byte number into the buffer at the specified index.
| ByteBuffer | ||
|
Puts a buffer into the buffer at the current position.
| ByteBuffer | ||
|
Puts a buffer into the buffer at the specified index.
| ByteBuffer | ||
|
putByteArray(v:ByteArray, offset:int = 0, length:int = 0):ByteBuffer
Puts a single-byte array into the buffer at the current position.
| ByteBuffer | ||
|
putByteArrayAt(index:int, v:ByteArray, offset:int = 0, length:int = 0):ByteBuffer
Puts a single-byte array into the buffer at the current position.
| ByteBuffer | ||
|
putBytes(v:Array):ByteBuffer
Puts a single-byte array into the buffer at the current position.
| ByteBuffer | ||
|
putBytesAt(index:int, v:Array):ByteBuffer
Puts a single-byte array into the buffer at the specified index.
| ByteBuffer | ||
|
putInt(v:int):ByteBuffer
Puts a four-byte number into the buffer at the current position.
| ByteBuffer | ||
|
putIntAt(index:int, v:*):ByteBuffer
Puts a four-byte number into the buffer at the specified index.
| ByteBuffer | ||
|
putMediumInt(v:int):ByteBuffer
Puts a three-byte number into the buffer at the current position.
| ByteBuffer | ||
|
putMediumIntAt(i:int, v:int):ByteBuffer
Puts a three-byte number into the buffer at the specified index.
| ByteBuffer | ||
|
Puts a string into the buffer at the specified index, using the
character set to encode the string as bytes.
| ByteBuffer | ||
|
putShort(v:int):ByteBuffer
Puts a two-byte number into the buffer at the current position.
| ByteBuffer | ||
|
putShortAt(index:int, v:int):ByteBuffer
Puts a two-byte number into the buffer at the specified index.
| ByteBuffer | ||
|
Puts a string into the buffer at the current position, using the
character set to encode the string as bytes.
| ByteBuffer | ||
|
putUnsigned(v:int):ByteBuffer
Puts an unsigned single-byte number into the buffer at the current position.
| ByteBuffer | ||
|
putUnsignedAt(index:int, v:int):ByteBuffer
Puts an unsigned single-byte number into the buffer at the specified position.
| ByteBuffer | ||
|
putUnsignedInt(v:uint):ByteBuffer
Puts an unsigned four-byte number into the buffer at the current position.
| ByteBuffer | ||
|
putUnsignedIntAt(index:int, v:uint):ByteBuffer
Puts an unsigned four-byte number into the buffer at the specified position.
| ByteBuffer | ||
|
putUnsignedShort(v:int):ByteBuffer
Puts an unsigned two-byte number into the buffer at the current position.
| ByteBuffer | ||
|
putUnsignedShortAt(index:int, v:int):ByteBuffer
Puts an unsigned two-byte number into the buffer at the specified position.
| ByteBuffer | ||
|
remaining():int
Returns the number of bytes remaining from the current position to the limit.
| ByteBuffer | ||
|
Resets the buffer position using the mark.
| ByteBuffer | ||
|
Rewinds the buffer.
| ByteBuffer | ||
|
skip(size:int):ByteBuffer
Skips the specified number of bytes from the current position.
| ByteBuffer | ||
|
Returns a sliced buffer, setting the position to zero, and
decrementing the limit accordingly.
| ByteBuffer | ||
|
toString():String
Returns the string representation of this buffer.
| ByteBuffer | ||
|
wrap(bytes:Array):ByteBuffer
[static]
Wraps a byte array as a new ByteBuffer instance.
| ByteBuffer | ||
|
wrapByteArray(bytes:ByteArray):ByteBuffer
[static]
| ByteBuffer | ||
| array | property |
public var array:ArrayThe array property provides byte storage for the buffer.
| autoExpand | property |
public var autoExpand:Boolean = trueThe autoExpand property enables writing variable length data, and is on by default.
| capacity | property |
public var capacity:int = 0The capacity property indicates the maximum number of bytes of storage available if the buffer is not automatically expanding.
| limit | property |
public var limit:int = 0The limit property indicates the last byte of data available for reading.
| order | property |
public var order:ByteOrderThe order property indicates the endianness of multibyte integer types in the buffer.
| position | property |
public var position:int = 0The position property indicates the progress through the buffer, and indicates the position within the underlying array that subsequent data will be read from or written to.
| ByteBuffer | () | constructor |
public function ByteBuffer(bytes:* = null)Creates a new ByteBuffer instance.
Parametersbytes:* (default = null) — bytes the byte-valued Number array
|
| allocate | () | method |
public static function allocate(capacity:int):ByteBufferAllocates a new ByteBuffer instance. The new buffer's position will be zero, its limit will be its capacity, and its mark will be undefined.
Parameterscapacity:int — the maximum buffer capacity
|
ByteBuffer —
the allocated ByteBuffer
|
| clear | () | method |
public function clear():ByteBufferClears the buffer. The position is set to zero, the limit is set to the capacity and the mark is reset.
ReturnsByteBuffer —
the buffer
|
| compact | () | method |
public function compact():ByteBufferCompacts the buffer by removing leading bytes up to the buffer position, and decrements the limit and position values accordingly.
ReturnsByteBuffer —
the buffer
|
| duplicate | () | method |
public function duplicate():ByteBufferDuplicates the buffer by reusing the underlying byte array but with independent position, limit and capacity.
ReturnsByteBuffer —
the duplicated buffer
|
| expand | () | method |
public function expand(expectedRemaining:int):ByteBufferExpands the buffer to support the expected number of remaining bytes after the current position.
ParametersexpectedRemaining:int — expectedRemaining the expected number of remaining bytes
|
ByteBuffer —
the buffer
|
| expandAt | () | method |
public function expandAt(i:int, expectedRemaining:int):ByteBufferExpands the buffer to support the expected number of remaining bytes at the specified index.
Parametersi:int — i the index
|
|
expectedRemaining:int — expectedRemaining the expected number of remaining bytes
|
ByteBuffer —
the buffer
|
| fill | () | method |
public function fill(size:int):ByteBufferFills the buffer with a repeated number of zeros.
Parameterssize:int — the number of zeros to repeat
|
ByteBuffer —
the buffer
|
| fillWith | () | method |
public function fillWith(b:int, size:int):ByteBufferFills the buffer with a specific number of repeated bytes.
Parametersb:int — the byte to repeat
|
|
size:int — the number of times to repeat
|
ByteBuffer —
the buffer
|
| flip | () | method |
public function flip():ByteBufferFlips the buffer. The limit is set to the current position, the position is set to zero, and the mark is reset.
ReturnsByteBuffer —
the flipped buffer
|
| get | () | method |
public function get():intReturns a single-byte number from the buffer at the current position.
Returnsint — the single-byte number
|
| getAt | () | method |
public function getAt(index:int):intReturns a single-byte number from the buffer at the specified index.
Parametersindex:int — the index
|
int — the single-byte number
|
| getByteArray | () | method |
public function getByteArray(length:int):ByteArrayReturns bytes in an ByteArray
Parameterslength:int — the number of bytes to read
|
ByteArray — a new ByteArray with bytes read from the buffer
|
| getByteArrayAt | () | method |
public function getByteArrayAt(index:int, length:int):ByteArrayReturns a ByteArray of length size from the buffer starting from the specified position.
Parametersindex:int — start index
|
|
length:int — the size of the buffer to be returned
|
ByteArray — a new byte array with bytes read from the buffer
|
| getBytes | () | method |
public function getBytes(length:int):ArrayReturns specified number of bytes in an array
Parameterslength:int — the number of bytes to read
|
Array — a new byte array with bytes read from the buffer
|
| getBytesAt | () | method |
public function getBytesAt(index:int, length:int):ArrayReturns a byte array of length size from the buffer starting from the specified position.
Parametersindex:int — start index
|
|
length:int — the size of the buffer to be returned
|
Array — a new byte array with bytes read from the buffer
|
| getHexDump | () | method |
public function getHexDump():StringReturns a hex dump of this buffer.
ReturnsString — the hex dump
|
| getInt | () | method |
public function getInt():intReturns a four-byte number from the buffer at the current position.
Returnsint — the four-byte number
|
| getIntAt | () | method |
public function getIntAt(index:int):intReturns a four-byte number from the buffer at the specified index.
Parametersindex:int — the index
|
int — the four-byte number
|
| getMediumInt | () | method |
public function getMediumInt():intReturns a three-byte number from the buffer at the current position.
Returnsint — the three-byte number
|
| getMediumIntAt | () | method |
public function getMediumIntAt(index:int):intReturns a three-byte number from the buffer at the specified index.
Parametersindex:int — the index
|
int — the three-byte number
|
| getPrefixedString | () | method |
public function getPrefixedString(fieldSize:int, cs:Charset):StringReturns a length-prefixed string from the buffer at the current position.
ParametersfieldSize:int — fieldSize the width in bytes of the prefixed length field
|
|
cs:Charset — cs the character set
|
String — the length-prefixed string
|
| getShort | () | method |
public function getShort():intReturns a two-byte number from the buffer at the current position.
Returnsint — the two-byte number
|
| getShortAt | () | method |
public function getShortAt(index:int):intReturns a two-byte number from the buffer at the specified index.
Parametersindex:int — the index
|
int — the two-byte number
|
| getString | () | method |
public function getString(cs:Charset):StringReturns a null-terminated string from the buffer at the current position. If the end of buffer if reached before discovering a null terminator byte, then the decoded string includes all bytes up to the end of the buffer.
Parameterscs:Charset — cs the character set
|
String — the null-terminated string
|
| getUnsigned | () | method |
public function getUnsigned():intReturns an unsigned single-byte number from the buffer at the current position.
Returnsint — the unsigned single-byte number
|
| getUnsignedAt | () | method |
public function getUnsignedAt(index:int):intReturns an unsigned single-byte number from the buffer at the specified index.
Parametersindex:int — the index
|
int — the unsigned single-byte number
|
| getUnsignedBytes | () | method |
public function getUnsignedBytes(length:int):ArrayReturns specified number of unsigned bytes in an array
Parameterslength:int — the number of bytes to read
|
Array — array of unsigned bytes
|
| getUnsignedInt | () | method |
public function getUnsignedInt():intReturns an unsigned four-byte number from the buffer at the current position.
Returnsint — the unsigned four-byte number
|
| getUnsignedIntAt | () | method |
public function getUnsignedIntAt(index:int):intReturns an unsigned four-byte number from the buffer at the specified index.
Parametersindex:int — the index
|
int — the unsigned four-byte number
|
| getUnsignedMediumInt | () | method |
public function getUnsignedMediumInt():intReturns an unsigned three-byte number from the buffer at the current position.
Returnsint — the unsigned three-byte number
|
| getUnsignedMediumIntAt | () | method |
public function getUnsignedMediumIntAt(index:int):intReturns an unsigned three-byte number from the buffer at the specified index.
Parametersindex:int — the index
|
int — the unsigned three-byte number
|
| getUnsignedShort | () | method |
public function getUnsignedShort():intReturns an unsigned two-byte number from the buffer at the current position.
Returnsint — the unsigned two-byte number
|
| getUnsignedShortAt | () | method |
public function getUnsignedShortAt(index:int):intReturns an unsigned two-byte number from the buffer at the specified index.
Parametersindex:int — the index
|
int — the unsigned two-byte number
|
| hasRemaining | () | method |
public function hasRemaining():BooleanReturns true if this buffer has remaining bytes, false otherwise.
ReturnsBoolean — whether this buffer has remaining bytes
|
| indexOf | () | method |
public function indexOf(b:int):intReturns the index of the specified byte in the buffer.
Parametersb:int — the byte to find
|
int — the index of the byte in the buffer, or -1 if not found
|
| mark | () | method |
public function mark():ByteBufferMarks a position in the buffer.
ReturnsByteBuffer —
the buffer
|
See also
| markValue | () | method |
public function markValue():intReturns the mark position in the buffer.
Returnsint — the mark position
|
See also
| put | () | method |
public function put(v:int):ByteBufferPuts a single byte number into the buffer at the current position.
Parametersv:int — the single-byte number
|
ByteBuffer —
the buffer
|
| putAt | () | method |
public function putAt(index:int, v:int):ByteBufferPuts a single byte number into the buffer at the specified index.
Parametersindex:int — the index
|
|
v:int — the single-byte number
|
ByteBuffer —
the buffer
|
| putBuffer | () | method |
public function putBuffer(v:ByteBuffer):ByteBufferPuts a buffer into the buffer at the current position.
Parametersv:ByteBuffer — the single-byte array
|
ByteBuffer —
the buffer
|
| putBufferAt | () | method |
public function putBufferAt(index:int, v:ByteBuffer):ByteBufferPuts a buffer into the buffer at the specified index.
Parametersindex:int — the index
|
|
v:ByteBuffer — the single-byte array
|
ByteBuffer —
the buffer
|
| putByteArray | () | method |
public function putByteArray(v:ByteArray, offset:int = 0, length:int = 0):ByteBufferPuts a single-byte array into the buffer at the current position.
Parametersv:ByteArray — the single-byte array
|
|
offset:int (default = 0) |
|
length:int (default = 0) |
ByteBuffer —
the buffer
|
| putByteArrayAt | () | method |
public function putByteArrayAt(index:int, v:ByteArray, offset:int = 0, length:int = 0):ByteBufferPuts a single-byte array into the buffer at the current position.
Parametersindex:int — the index
|
|
v:ByteArray — the single-byte array
|
|
offset:int (default = 0) |
|
length:int (default = 0) |
ByteBuffer —
the buffer
|
| putBytes | () | method |
public function putBytes(v:Array):ByteBufferPuts a single-byte array into the buffer at the current position.
Parametersv:Array — the single-byte array
|
ByteBuffer —
the buffer
|
| putBytesAt | () | method |
public function putBytesAt(index:int, v:Array):ByteBufferPuts a single-byte array into the buffer at the specified index.
Parametersindex:int — the index
|
|
v:Array — the single-byte array
|
ByteBuffer —
the buffer
|
| putInt | () | method |
public function putInt(v:int):ByteBufferPuts a four-byte number into the buffer at the current position.
Parametersv:int — the four-byte number
|
ByteBuffer —
the buffer
|
| putIntAt | () | method |
public function putIntAt(index:int, v:*):ByteBufferPuts a four-byte number into the buffer at the specified index.
Parametersindex:int — the index
|
|
v:* — the four-byte number
|
ByteBuffer —
the buffer
|
| putMediumInt | () | method |
public function putMediumInt(v:int):ByteBufferPuts a three-byte number into the buffer at the current position.
Parametersv:int — the three-byte number
|
ByteBuffer —
the buffer
|
| putMediumIntAt | () | method |
public function putMediumIntAt(i:int, v:int):ByteBufferPuts a three-byte number into the buffer at the specified index.
Parametersi:int — the index
|
|
v:int — the three-byte number
|
ByteBuffer —
the buffer
|
| putPrefixedString | () | method |
public function putPrefixedString(fieldSize:int, v:String, cs:Charset):ByteBufferPuts a string into the buffer at the specified index, using the character set to encode the string as bytes.
ParametersfieldSize:int — the width in bytes of the prefixed length field
|
|
v:String — the string
|
|
cs:Charset — the character set
|
ByteBuffer —
the buffer
|
| putShort | () | method |
public function putShort(v:int):ByteBufferPuts a two-byte number into the buffer at the current position.
Parametersv:int — the two-byte number
|
ByteBuffer —
the buffer
|
| putShortAt | () | method |
public function putShortAt(index:int, v:int):ByteBufferPuts a two-byte number into the buffer at the specified index.
Parametersindex:int — the index
|
|
v:int — the two-byte number
|
ByteBuffer —
the buffer
|
| putString | () | method |
public function putString(v:String, cs:Charset):ByteBufferPuts a string into the buffer at the current position, using the character set to encode the string as bytes.
Parametersv:String — the string
|
|
cs:Charset — the character set
|
ByteBuffer —
the buffer
|
| putUnsigned | () | method |
public function putUnsigned(v:int):ByteBufferPuts an unsigned single-byte number into the buffer at the current position.
Parametersv:int — the unsigned byte as an int
|
ByteBuffer —
the buffer
|
| putUnsignedAt | () | method |
public function putUnsignedAt(index:int, v:int):ByteBufferPuts an unsigned single-byte number into the buffer at the specified position.
Parametersindex:int — the index
|
|
v:int — the unsigned byte as an int
|
ByteBuffer —
the buffer
|
| putUnsignedInt | () | method |
public function putUnsignedInt(v:uint):ByteBufferPuts an unsigned four-byte number into the buffer at the current position.
Parametersv:uint — the four-byte number
|
ByteBuffer —
the buffer
|
| putUnsignedIntAt | () | method |
public function putUnsignedIntAt(index:int, v:uint):ByteBufferPuts an unsigned four-byte number into the buffer at the specified position.
Parametersindex:int — the index
|
|
v:uint — the four-byte number
|
ByteBuffer —
the buffer
|
| putUnsignedShort | () | method |
public function putUnsignedShort(v:int):ByteBufferPuts an unsigned two-byte number into the buffer at the current position.
Parametersv:int — the two-byte number
|
ByteBuffer —
the buffer
|
| putUnsignedShortAt | () | method |
public function putUnsignedShortAt(index:int, v:int):ByteBufferPuts an unsigned two-byte number into the buffer at the specified position.
Parametersindex:int — the index
|
|
v:int — the two-byte number
|
ByteBuffer —
the buffer
|
| remaining | () | method |
public function remaining():intReturns the number of bytes remaining from the current position to the limit.
Returnsint — the number of bytes remaining
|
| reset | () | method |
public function reset():ByteBufferResets the buffer position using the mark.
ReturnsByteBuffer —
the buffer
|
— if the mark is invalid
|
See also
| rewind | () | method |
public function rewind():ByteBufferRewinds the buffer. The position is set to zero and the mark is reset.
ReturnsByteBuffer —
the buffer
|
| skip | () | method |
public function skip(size:int):ByteBufferSkips the specified number of bytes from the current position.
Parameterssize:int — size the number of bytes to skip
|
ByteBuffer —
the buffer
|
| slice | () | method |
public function slice():ByteBufferReturns a sliced buffer, setting the position to zero, and decrementing the limit accordingly.
ReturnsByteBuffer —
the sliced buffer
|
| toString | () | method |
public function toString():StringReturns the string representation of this buffer.
ReturnsString — the string representation
|
| wrap | () | method |
public static function wrap(bytes:Array):ByteBufferWraps a byte array as a new ByteBuffer instance.
Parametersbytes:Array — an array of byte-sized numbers
|
ByteBuffer —
the bytes wrapped as a ByteBuffer
|
| wrapByteArray | () | method |
public static function wrapByteArray(bytes:ByteArray):ByteBufferParameters
bytes:ByteArray |
ByteBuffer |