|
|||||||||
| 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 writing, 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 | |
int |
available()
Returns the number of bytes available from the actual read position |
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(). |
byte[] |
getCopy()
Returns a copy of the data inside this buffer. |
boolean |
isOpen()
Returns true if buffer is not null |
void |
mark()
Sets the current position as the maximum size of the buffer so that no more than the current written data will be read. |
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, and sets the mark to the buffer real limits. |
int |
reuse()
Reuses the already read part of the buffer. |
void |
setSize(int newSize,
boolean copyOldData)
Sets the size of the current byte array. |
int |
skipBytes(int count)
Skips the number of bytes from the current position. |
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 |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ByteArrayStream(byte[] buffer)
public ByteArrayStream(int size)
| Method Detail |
public void mark()
public int available()
public boolean close()
public byte[] getBuffer()
public int count()
public int readBytes(byte[] buf,
int start,
int count)
public void reset()
public int skipBytes(int count)
public int reuse()
public int writeBytes(byte[] buf,
int start,
int count)
public boolean isOpen()
public void setSize(int newSize,
boolean copyOldData)
pos is copied into the new buffer.public byte[] getCopy()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||