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.


Variable Index

 o STARTSIZE

Constructor Index

 o ByteBuffer()
Default constructor
 o ByteBuffer(byte[], int)
Constructor from a byte[], copys a subarray into the object

Method Index

 o append(byte)
append byte b to the end of the buffer.
 o append(byte[])
append the array to the end of the buffer.
 o append(byte[], int)
append the subarray to the end of the buffer.
 o append(ByteBuffer)
append a ByteBuffer to the end of the buffer.
 o append(String)
Append a string to the end of the array, 16-bit characters truncated to 8-bit characters
 o array()
return the byte[] array
 o byteAt(int)
byte at an index
 o equals(byte[])
implementation of equals
 o main(String[])
Test harness
 o removeBeginning(int)
remove the first length
 o setByteAt(int, byte)
sets the byte at an index to b
 o size()
size of the array
 o toString()
return the string representation of the array
 o toString(int)
return the string representation of the array to this length

Variables

 o STARTSIZE
 public static int STARTSIZE

Constructors

 o ByteBuffer
 public ByteBuffer()
Default constructor

 o 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

Methods

 o append
 public ByteBuffer append(byte b)
append byte b to the end of the buffer.

 o append
 public ByteBuffer append(byte array[])
append the array to the end of the buffer.

 o append
 public ByteBuffer append(byte array[],
                          int size)
append the subarray to the end of the buffer.

 o append
 public ByteBuffer append(ByteBuffer buffer)
append a ByteBuffer to the end of the buffer.

 o append
 public ByteBuffer append(String str)
Append a string to the end of the array, 16-bit characters truncated to 8-bit characters

 o array
 public byte[] array()
return the byte[] array

 o byteAt
 public byte byteAt(int index) throws ArrayIndexOutOfBoundsException
byte at an index

 o equals
 public boolean equals(byte array[])
implementation of equals

 o size
 public int size()
size of the array

 o setByteAt
 public void setByteAt(int index,
                       byte b) throws ArrayIndexOutOfBoundsException
sets the byte at an index to b

 o removeBeginning
 public void removeBeginning(int length)
remove the first length

 o toString
 public String toString()
return the string representation of the array

Overrides:
toString in class Object
 o toString
 public String toString(int len)
return the string representation of the array to this length

 o main
 public static void main(String args[])
Test harness


All Packages  Class Hierarchy  This Package  Previous  Next  Index