com.healthmarketscience.rmiio
Class RemoteInputStreamClient

java.lang.Object
  extended by com.healthmarketscience.rmiio.RemoteInputStreamClient

public class RemoteInputStreamClient
extends Object

Utility which provides a wrapper InputStream for the client of a RemoteInputStream. The wrapper will automagically handle any compression needs of the remote stream. RemoteException's will be retried using the given RemoteRetry implementation. Note that the InputStreams will not support mark()/reset() stream functionality. Users should generally not need to wrap the returned stream with a BufferedInputStream as buffering will be done by the returned implementation (unless *large* amounts of buffering are desired).

Author:
James Ahlborn

Field Summary
protected static org.apache.commons.logging.Log LOG
           
 
Method Summary
static InputStream wrap(RemoteInputStream remoteIn)
          Wraps a RemoteInputStream as an InputStream using the RemoteClient.DEFAULT_RETRY retry policy.
static InputStream wrap(RemoteInputStream remoteIn, RemoteRetry retry)
          Wraps a RemoteInputStream as an InputStream using the given retry strategy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Method Detail

wrap

public static InputStream wrap(RemoteInputStream remoteIn)
                        throws IOException
Wraps a RemoteInputStream as an InputStream using the RemoteClient.DEFAULT_RETRY retry policy.

Parameters:
remoteIn - a remote input stream interface
Returns:
an InputStream which will read from the given RemoteInputStream
Throws:
IOException

wrap

public static InputStream wrap(RemoteInputStream remoteIn,
                               RemoteRetry retry)
                        throws IOException
Wraps a RemoteInputStream as an InputStream using the given retry strategy.

Parameters:
remoteIn - a remote input stream interface
retry - RemoteException retry policy to use, if null, RemoteClient.DEFAULT_RETRY will be used.
Returns:
an InputStream which will read from the given RemoteInputStream
Throws:
IOException


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