com.healthmarketscience.rmiio
Class SimpleRemoteInputStream
java.lang.Object
com.healthmarketscience.rmiio.RemoteStreamServer<RemoteInputStreamServer,RemoteInputStream>
com.healthmarketscience.rmiio.RemoteInputStreamServer
com.healthmarketscience.rmiio.SimpleRemoteInputStream
- All Implemented Interfaces:
- RemoteInputStream, Closeable, Serializable, Remote, Unreferenced
public class SimpleRemoteInputStream
- extends RemoteInputStreamServer
Concrete implementation of a RemoteInputStreamServer which sends
uncompressed data, which it will read directly from the underlying
InputStream.
- Author:
- James Ahlborn
- See Also:
- Usage Notes,
RemoteStreamServer.writeReplace()
,
Serialized Form
Method Summary |
protected int |
availableImpl()
Returns the number of bytes that can be read from this stream without
blocking. |
protected byte[] |
readPacket()
Reads the next packet of approximately RemoteInputStreamServer._chunkSize from the
underlying stream and returns it. |
protected long |
skip(long n)
Skips at most the given amount of bytes in the underlying stream and
returns the actual number of bytes skipped. |
boolean |
usingGZIPCompression()
Returns true if the stream is using GZIP compression over
the wire. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleRemoteInputStream
public SimpleRemoteInputStream(InputStream in)
SimpleRemoteInputStream
public SimpleRemoteInputStream(InputStream in,
RemoteStreamMonitor<RemoteInputStreamServer> monitor)
SimpleRemoteInputStream
public SimpleRemoteInputStream(InputStream in,
RemoteStreamMonitor<RemoteInputStreamServer> monitor,
int chunkSize)
usingGZIPCompression
public boolean usingGZIPCompression()
- Description copied from interface:
RemoteInputStream
- Returns
true
if the stream is using GZIP compression over
the wire.
- Returns:
true
iff the stream data is compressed,
false
otherwise
availableImpl
protected int availableImpl()
throws IOException
- Description copied from class:
RemoteInputStreamServer
- Returns the number of bytes that can be read from this stream without
blocking.
- Specified by:
availableImpl
in class RemoteInputStreamServer
- Returns:
- the number of bytes that can be read without blocking
- Throws:
IOException
readPacket
protected byte[] readPacket()
throws IOException
- Description copied from class:
RemoteInputStreamServer
- Reads the next packet of approximately
RemoteInputStreamServer._chunkSize
from the
underlying stream and returns it. If this stream is using compression,
this packet should contain compressed data.
- Specified by:
readPacket
in class RemoteInputStreamServer
- Returns:
- the next packet of data for this stream
- Throws:
IOException
skip
protected long skip(long n)
throws IOException
- Description copied from class:
RemoteInputStreamServer
- Skips at most the given amount of bytes in the underlying stream and
returns the actual number of bytes skipped.
- Specified by:
skip
in class RemoteInputStreamServer
- Returns:
- the actual number of bytes skipped
- Throws:
IOException
Copyright © 2006–2016 Health Market Science. All rights reserved.