Class next.util.ImmutableBytes

CLASS DESCRIPTION

Extends:
next.util.NextObject

Implements:
next/util/Coding

The ImmutableBytes class declares the programmatic interface to an object that contains immutable data in the form of bytes. The bytes method returns the bytes contained in the ImmutableBytes object, and can return a range of bytes from a starting point within the bytes themselves. length returns the number of bytes contained in the ImmutableBytes object.


CONSTRUCTORS

ImmutableBytes

public ImmutableBytes()
public ImmutableBytes(byte[] bytes)
public ImmutableBytes(byte[] bytes, int start, int length)

Returns a newly allocated and initialized ImmutableBytes object. If bytes is supplied, the new object is initialized from the array of bytes. start and length can be used to qualify which bytes within bytes are used to initialize the new ImmutableBytes object.


METHODS

bytes

public byte[] bytes(int start, int length)

Returns the specified portion of the receiver's contents as an array of bytes. Specify the portion to be returned with start and length. If the specified range of bytes isn't within the receiver's set of bytes, an IndexOutOfBoundsException is raised.


encodeWithCoder

public void encodeWithCoder(next.util.Coder aCoder)

Encodes the receiver using aCoder. See the Coding interface description for more information.


initWithBytes

protected void initWithBytes(byte[] bytes, int length, int anInt)

Initializes a newly allocated ImmutableBytes object by adding to it length bytes of data copied from the buffer bytes.


length

public int length()

Returns the number of bytes contained in the receiver.