com.healthmarketscience.rmiio
Class SimpleRemoteInputStream

java.lang.Object
  extended by com.healthmarketscience.rmiio.RemoteStreamServer<RemoteInputStreamServer,RemoteInputStream>
      extended by com.healthmarketscience.rmiio.RemoteInputStreamServer
          extended by 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

Field Summary
 
Fields inherited from class com.healthmarketscience.rmiio.RemoteInputStreamServer
_chunkSize, _in, DEFAULT_CHUNK_SIZE, DUMMY_MONITOR
 
Fields inherited from class com.healthmarketscience.rmiio.RemoteStreamServer
_monitor, INITIAL_INVALID_SEQUENCE_ID, INITIAL_VALID_SEQUENCE_ID, LOG
 
Constructor Summary
SimpleRemoteInputStream(InputStream in)
           
SimpleRemoteInputStream(InputStream in, RemoteStreamMonitor<RemoteInputStreamServer> monitor)
           
SimpleRemoteInputStream(InputStream in, RemoteStreamMonitor<RemoteInputStreamServer> monitor, int chunkSize)
           
 
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 com.healthmarketscience.rmiio.RemoteInputStreamServer
available, close, closeImpl, getAsSub, getInputStream, getLock, getRemoteClass, readPacket, skip
 
Methods inherited from class com.healthmarketscience.rmiio.RemoteStreamServer
abort, checkAborted, close, export, exported, finish, isClosed, unreferenced, writeReplace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleRemoteInputStream

public SimpleRemoteInputStream(InputStream in)

SimpleRemoteInputStream

public SimpleRemoteInputStream(InputStream in,
                               RemoteStreamMonitor<RemoteInputStreamServer> monitor)

SimpleRemoteInputStream

public SimpleRemoteInputStream(InputStream in,
                               RemoteStreamMonitor<RemoteInputStreamServer> monitor,
                               int chunkSize)
Method Detail

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.