Bytes

extends Node

A Bytes node represents a sequence of bytes.

Constructors

Bytes other, Node deep value = new byte[other.value.length]; System.arraycopy(other.value, 0, value, 0, value.length); Node value this.value = value.byteValue(); value = new byte[0];

Type Functions

append(Bytes bytes)

Append bytes to the end of this sequence of bytes.

Returns: This Bytes.

boolean()

Returns: Boolean false if this byte sequence is empty or contains a single 0-valued byte.

byte(Node index)

Get the byte at the given position in this byte sequence

Parameter index: Index into this byte sequence, starting at 0.

Returns: The indexed byte as a Number, or an empty nodeset if the index is not valid for this byte sequence

bytes(Node start, Node length)

Get a new Bytes that consists of the sequence of bytes in this Bytes starting at start for length bytes.

Parameter start: Start index into this byte sequence, starting at 0.

length()

Get the length of this byte sequence

Returns: The number of bytes

prepend(Bytes bytes)

Prepend bytes to the beginning of this sequence of bytes.

Returns: This Bytes.

string()

Functions inherited from Node