|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.io.Stream | +--waba.io.ByteArrayStream
creates a byte array stream. it can be useful with the method Catalog.inspectRecord, since that method returns a byte array. When writting, the buffer expands itself if needed. This class cannot be used for output AND input, but only for output OR input.
Constructor Summary | |
ByteArrayStream(byte[] buffer)
sets the internal buffer to be the specified buffer param. |
|
ByteArrayStream(int size)
creates a new buffer with the specific size. |
Method Summary | |
boolean |
close()
does nothing. |
int |
count()
returns the current position in the buffer. |
byte[] |
getBuffer()
gets the buffer used. the size of the buffer may be different of the array length. get its size in count(). |
boolean |
isOpen()
Returns true if this Stream is open and false otherwise |
int |
readBytes(byte[] buf,
int start,
int count)
transfers count bytes from class buffer to buf. |
void |
reset()
resets the position to 0 so the buffer can be reused. |
int |
writeBytes(byte[] buf,
int start,
int count)
this writes to the byte array, expanding it if necessary. returns the number of bytes written. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
Constructor Detail |
public ByteArrayStream(byte[] buffer)
public ByteArrayStream(int size)
Method Detail |
public boolean close()
public byte[] getBuffer()
public int count()
public int readBytes(byte[] buf, int start, int count)
public void reset()
public int writeBytes(byte[] buf, int start, int count)
public boolean isOpen()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |