|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.healthmarketscience.rmiio.util.InputStreamAdapter
public abstract class InputStreamAdapter
Utility class for optimizing different read strategies based on the type of the underlying InputStream.
Method Summary | |
---|---|
static InputStreamAdapter |
create(InputStream istream,
int packetSize)
|
abstract InputStream |
getInputStream()
|
abstract byte[] |
getTempBuffer()
|
abstract byte[] |
readPacket()
Gets the next "packet" from the internal buffer and returns it (if any). |
abstract int |
readTemp()
Reads some number of bytes from the underlying stream and puts them in a buffer available from the getTempBuffer() call. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract InputStream getInputStream()
public abstract byte[] readPacket() throws IOException
readPacket(false)
).
Note, this method is slightly optimized for current usage, so an implementation caveat is that the returned packet must be "consumed" before another call to readPacket is made.
null
if the end of
stream has been reached
IOException
public abstract byte[] getTempBuffer()
readTemp()
callpublic abstract int readTemp() throws IOException
getTempBuffer()
call.
IOException
public static InputStreamAdapter create(InputStream istream, int packetSize)
istream
- stream to wrap and for which the implementation is
optimizedpacketSize
- recommended packet size for any created packets
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |