All Packages Class Hierarchy This Package Previous Next Index
Class aka.snmp.ByteBuffer
java.lang.Object
|
+----aka.snmp.ByteBuffer
- public class ByteBuffer
- extends Object
This class is similar to StringBuffer, but handles arrays of 8-bit
characters.
-
STARTSIZE
-
-
ByteBuffer()
-
Default constructor
-
ByteBuffer(byte[], int)
- Constructor from a byte[], copys a subarray into the object
-
append(byte)
- append byte b to the end of the buffer.
-
append(byte[])
- append the array to the end of the buffer.
-
append(byte[], int)
- append the subarray to the end of the buffer.
-
append(ByteBuffer)
- append a ByteBuffer to the end of the buffer.
-
append(String)
- Append a string to the end of the array, 16-bit characters truncated
to 8-bit characters
-
array()
- return the byte[] array
-
byteAt(int)
- byte at an index
-
equals(byte[])
-
implementation of equals
-
main(String[])
- Test harness
-
removeBeginning(int)
- remove the first length
-
setByteAt(int, byte)
- sets the byte at an index to b
-
size()
- size of the array
-
toString()
- return the string representation of the array
-
toString(int)
- return the string representation of the array to this length
STARTSIZE
public static int STARTSIZE
ByteBuffer
public ByteBuffer()
- Default constructor
ByteBuffer
public ByteBuffer(byte array[],
int length)
- Constructor from a byte[], copys a subarray into the object
- Parameters:
- array - the array
- length - length of the subarray
append
public ByteBuffer append(byte b)
- append byte b to the end of the buffer.
append
public ByteBuffer append(byte array[])
- append the array to the end of the buffer.
append
public ByteBuffer append(byte array[],
int size)
- append the subarray to the end of the buffer.
append
public ByteBuffer append(ByteBuffer buffer)
- append a ByteBuffer to the end of the buffer.
append
public ByteBuffer append(String str)
- Append a string to the end of the array, 16-bit characters truncated
to 8-bit characters
array
public byte[] array()
- return the byte[] array
byteAt
public byte byteAt(int index) throws ArrayIndexOutOfBoundsException
- byte at an index
equals
public boolean equals(byte array[])
- implementation of equals
size
public int size()
- size of the array
setByteAt
public void setByteAt(int index,
byte b) throws ArrayIndexOutOfBoundsException
- sets the byte at an index to b
removeBeginning
public void removeBeginning(int length)
- remove the first length
toString
public String toString()
- return the string representation of the array
- Overrides:
- toString in class Object
toString
public String toString(int len)
- return the string representation of the array to this length
main
public static void main(String args[])
- Test harness
All Packages Class Hierarchy This Package Previous Next Index