|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object m.c.m.proxyma.buffers.SmartBufferReader
public class SmartBufferReader
This class implements a Reader Class for the SmartBuffer. To read more than once the same data you have to execute reset() method between every read operation.
NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.
Constructor Summary | |
---|---|
SmartBufferReader(SmartBuffer buffer)
This constructor builds a new Reader based upon the passed SmartBuffer. |
Method Summary | |
---|---|
long |
getSize()
Returns the size (in bytes) of the data into the buffer. |
byte[] |
getWholeBufferAsByteArray()
Returns the whole buffer into a byte array. |
int |
readByte()
Read a single byte of data from the buffer |
int |
readBytes(byte[] data,
int size)
Reads data from the buffer and stores them into the provided byte array. |
void |
reset()
Resets the Reader, next read operation will start fom the begin of the buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SmartBufferReader(SmartBuffer buffer) throws java.io.IOException
buffer
- the SmartBuffer where read data
java.io.IOException
Method Detail |
---|
public int readBytes(byte[] data, int size) throws java.io.IOException
readBytes
in interface ByteBufferReader
data
- the byte array where data will be writtensize
- the max number of data that can be written.
java.io.IOException
- if something goes wrongpublic int readByte() throws java.io.IOException
readByte
in interface ByteBufferReader
java.io.IOException
- if something goes wrongpublic void reset() throws java.io.IOException
reset
in interface ByteBufferReader
java.io.IOException
public byte[] getWholeBufferAsByteArray() throws java.io.IOException
getWholeBufferAsByteArray
in interface ByteBufferReader
java.io.IOException
public long getSize()
getSize
in interface ByteBufferReader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |