|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.autonomy.utilities.ByteArrayBuffer
Analogy of a StringBuffer but uses a byte array not a char array.
Useful for storing a dynamic set of bytes
Constructor Summary | |
ByteArrayBuffer()
Creates a byte array buffer with a default size |
|
ByteArrayBuffer(byte[] bInitial)
Creates a byte array buffer from a byte array |
|
ByteArrayBuffer(int nSize)
Creates a byte array with a given size |
|
ByteArrayBuffer(java.lang.String sInitial,
int nInitialSpace,
java.lang.String sEncoding)
Constructor. |
Method Summary | |
void |
append(byte b)
Append a single byte |
void |
append(byte[] baAppend)
Append an entire byte array |
void |
append(byte[] baAppend,
int nToAppend)
Append a portion of a byte array |
void |
append(byte[] baAppend,
int nStart,
int nToAppend)
Append a portion of a byte array |
void |
append(com.autonomy.utilities.ByteArrayBuffer babAppend)
Append the entire contents of ByteArrayBuffer |
void |
append(java.lang.String sAppend)
Append a string using the provided encoding |
byte[] |
getBytes()
Return the byte array |
int |
length()
Return the length of the current buffer |
void |
setEncoding(java.lang.String sEncoding)
Set encoding used for coverting Strings to bytes |
java.lang.String |
toString()
Convert the buffer to a string, using the character encoding specified in setEncoding |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ByteArrayBuffer(java.lang.String sInitial, int nInitialSpace, java.lang.String sEncoding)
sInitial
- Initial string to place in buffernInitialSpace
- How much space in bytes to give to the buffersEncoding
- Encoding to use to convert from String to bytespublic ByteArrayBuffer()
public ByteArrayBuffer(byte[] bInitial)
bInitial
- Byte array to use a source for bufferpublic ByteArrayBuffer(int nSize)
nSize
- Initial size for bufferMethod Detail |
public void setEncoding(java.lang.String sEncoding)
sEncoding
- Encoding to usepublic void append(java.lang.String sAppend)
sAppend
- String to appendpublic void append(byte[] baAppend, int nToAppend)
baAppend
- byte array to appendnToAppend
- Number of bytes to append, starting from the beginning of the arraypublic void append(byte[] baAppend, int nStart, int nToAppend)
baAppend
- byte array to appendnStart
- Index in baAppend from which to startnToAppend
- Number of bytes to appendpublic void append(byte[] baAppend) throws java.lang.ArrayStoreException
baAppend
- Byte array
java.lang.ArrayStoreException
public void append(com.autonomy.utilities.ByteArrayBuffer babAppend) throws java.lang.ArrayStoreException
java.lang.ArrayStoreException
public void append(byte b)
b
- Byte to appendpublic byte[] getBytes()
public int length()
public java.lang.String toString()
toString
in class java.lang.Object
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |