saker.build Documentation TaskDoc JavaDoc Packages
public class ByteVector
A dynamically extensible vector of bytes. This class is roughly equivalent to a DataOutputStream on top of a ByteArrayOutputStream, but is more efficient.
Constructors
public
Constructs a new ByteVector with a default initial capacity.
public
ByteVector(int initialCapacity)
Constructs a new ByteVector with the given initial capacity.
Methods
public ByteVector
putByte(int byteValue)
Puts a byte into this byte vector.
public ByteVector
putByteArray(byte[] byteArrayValue, int byteOffset, int byteLength)
Puts an array of bytes into this byte vector.
public ByteVector
putInt(int intValue)
Puts an int into this byte vector.
public ByteVector
putLong(long longValue)
Puts a long into this byte vector.
public ByteVector
putShort(int shortValue)
Puts a short into this byte vector.
public ByteVector
putUTF8(String stringValue)
Puts an UTF8 string into this byte vector.
public ByteVector()
Constructs a new ByteVector with a default initial capacity.
public ByteVector(int initialCapacity)
Constructs a new ByteVector with the given initial capacity.
initialCapacitythe initial capacity of the byte vector to be constructed.
public ByteVector putByte(int byteValue)
Puts a byte into this byte vector. The byte vector is automatically enlarged if necessary.
byteValuea byte.
this byte vector.
public ByteVector putByteArray(byte[] byteArrayValue, int byteOffset, int byteLength)
Puts an array of bytes into this byte vector. The byte vector is automatically enlarged if necessary.
byteArrayValuean array of bytes. May be null to put byteLength null bytes into this byte vector.
byteOffsetindex of the first byte of byteArrayValue that must be copied.
byteLengthnumber of bytes of byteArrayValue that must be copied.
this byte vector.
public ByteVector putInt(int intValue)
Puts an int into this byte vector. The byte vector is automatically enlarged if necessary.
intValuean int.
this byte vector.
public ByteVector putLong(long longValue)
Puts a long into this byte vector. The byte vector is automatically enlarged if necessary.
longValuea long.
this byte vector.
public ByteVector putShort(int shortValue)
Puts a short into this byte vector. The byte vector is automatically enlarged if necessary.
shortValuea short.
this byte vector.
public ByteVector putUTF8(String stringValue)
Puts an UTF8 string into this byte vector. The byte vector is automatically enlarged if necessary.
stringValuea String whose UTF8 encoded length must be less than 65536.
this byte vector.