All Packages This Package Class Hierarchy Class Search Index
Class edu.utah.janos.antsr.core.ByteArray
java.lang.Object
|
+----edu.utah.janos.antsr.core.ByteArray
public class ByteArray
extends java.lang.Object
{
// Fields 3
public byte[] buf;
public int len;
public int offset;
// Constructors 6
public ByteArray(byte[]);
public ByteArray(byte[], int);
public ByteArray(byte[], int, int) throws IndexOutOfBoundsException;
public ByteArray(ByteArray, int);
public ByteArray(ByteArray, int, int) throws IndexOutOfBoundsException;
public ByteArray(int);
// Methods 8
public final byte getByte(int) throws IndexOutOfBoundsException;
public final void getBytes(int, byte[], int, int);
public final int length();
public final void setByte(int, byte) throws IndexOutOfBoundsException;
public final void setBytes(int, byte[], int, int);
public final void setBytes(int, ByteArray, int, int);
public final byte[] toBytes();
public String toString();
}
Wrapper for an array of Bytes. Incorporates offset and length.
Most of the methods in here are final for performance reasons.
- Author:
-
probably David Wetherall.
- Returned By:
- DataCapsule.getData(), Xdr.BYTEARRAY()
public byte[] buf
public int offset
public int len
public ByteArray(int len)
public ByteArray(byte[] buf)
public ByteArray(byte[] buf,
int offset)
public ByteArray(byte[] buf,
int offset,
int len) throws IndexOutOfBoundsException
public ByteArray(ByteArray parent,
int offset)
public ByteArray(ByteArray parent,
int offset,
int len) throws IndexOutOfBoundsException
public final int length()
public final byte getByte(int index) throws IndexOutOfBoundsException
public final void setByte(int index,
byte val) throws IndexOutOfBoundsException
public final void getBytes(int srcBegin,
byte[] dst,
int dstBegin,
int length)
public final void setBytes(int dstBegin,
byte[] src,
int srcBegin,
int length)
public final void setBytes(int dstBegin,
ByteArray src,
int srcBegin,
int length)
public final byte[] toBytes()
Returns a byte array exactly the right size for
the valid data in the buf. Note that if this.buf
is the right side it is returned directly, otherwise
a new array is created of the right size. (Weird.)
- Returns:
- array of bytes
public String toString()
- Overrides:
- toString in class Object
All Packages This Package Class Hierarchy Class Search Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7