com.healthmarketscience.rmiio
Class SerializableInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by com.healthmarketscience.rmiio.SerializableInputStream
All Implemented Interfaces:
RemoteClient, Closeable, Serializable

public class SerializableInputStream
extends InputStream
implements Serializable, RemoteClient

An additional layer around a RemoteInputStream which makes it Serializable and an InputStream. In general, this extra layer is not necessary and I do not recommend using this class. However, in the odd case where the callee really wants to get something which is already an InputStream, this class can be useful. This is basically just a wrapper around a call to RemoteInputStreamClient.wrap(com.healthmarketscience.rmiio.RemoteInputStream).

Author:
James Ahlborn
See Also:
Usage Notes, Serialized Form

Field Summary
 
Fields inherited from interface com.healthmarketscience.rmiio.RemoteClient
DEFAULT_RETRY
 
Constructor Summary
SerializableInputStream(InputStream localIn)
           
SerializableInputStream(RemoteInputStream remoteIn)
           
 
Method Summary
 int available()
           
 void close()
           
 int read()
           
 int read(byte[] b)
           
 int read(byte[] buf, int pos, int len)
           
 void setRemoteRetry(RemoteRetry retry)
          Sets the client side RemoteRetry policy to use for the underlying remote communication layer.
 long skip(long len)
           
 
Methods inherited from class java.io.InputStream
mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializableInputStream

public SerializableInputStream(InputStream localIn)
                        throws IOException
Throws:
IOException

SerializableInputStream

public SerializableInputStream(RemoteInputStream remoteIn)
Method Detail

setRemoteRetry

public void setRemoteRetry(RemoteRetry retry)
Description copied from interface: RemoteClient
Sets the client side RemoteRetry policy to use for the underlying remote communication layer. For most client side implementations, this method must be called before any other calls on this client object (any calls to this method after one of those methods is called will have no affect).

Specified by:
setRemoteRetry in interface RemoteClient
Parameters:
retry - the new RemoteRetry policy to use for remote communication. null causes the RemoteClient.DEFAULT_RETRY policy to be used.

available

public int available()
              throws IOException
Overrides:
available in class InputStream
Throws:
IOException

read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

read

public int read(byte[] buf,
                int pos,
                int len)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException

skip

public long skip(long len)
          throws IOException
Overrides:
skip in class InputStream
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException


Copyright © 2006–2016 Health Market Science. All rights reserved.