|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.healthmarketscience.rmiio.DirectRemoteInputStream
public class DirectRemoteInputStream
RemoteInputStream implementation which mimics the RemoteInputStream functionality while not actually causing any additional RMI invocations. This class is not recommended for general use, but may be useful (or even required) in certain scenarios. It basically works by writing the stream data directly into the ObjectOutputStream during serialization. There are a variety of implications to this approach, so please read the pros and cons list carefully before deciding to use this class.
Finally, the good news is that since this implementation is a RemoteInputStream, the client-side decision to use this class will not impact the server. If the need arises in the future, client code which uses this class may switch over to using one of the more robust RemoteInputStream implementations without any changes to the server.
Constructor Summary | |
---|---|
DirectRemoteInputStream(InputStream in)
|
|
DirectRemoteInputStream(InputStream in,
boolean compress)
|
|
DirectRemoteInputStream(InputStream in,
boolean compress,
RemoteStreamMonitor<RemoteInputStreamServer> monitor)
|
Method Summary | |
---|---|
int |
available()
Returns the number of bytes that can be read from this stream without blocking. |
void |
close()
|
void |
close(boolean readSuccess)
Closes the input stream and releases the resources for this server object. |
byte[] |
readPacket(int packetId)
Reads the next chunk of data for this stream. |
long |
skip(long n,
int skipId)
Skips and discards up to the given number of bytes in the 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 |
Constructor Detail |
---|
public DirectRemoteInputStream(InputStream in)
public DirectRemoteInputStream(InputStream in, boolean compress)
public DirectRemoteInputStream(InputStream in, boolean compress, RemoteStreamMonitor<RemoteInputStreamServer> monitor)
Method Detail |
---|
public boolean usingGZIPCompression() throws IOException, RemoteException
RemoteInputStream
true
if the stream is using GZIP compression over
the wire.
usingGZIPCompression
in interface RemoteInputStream
true
iff the stream data is compressed,
false
otherwise
IOException
RemoteException
public int available() throws IOException, RemoteException
RemoteInputStream
available
in interface RemoteInputStream
IOException
RemoteException
public void close(boolean readSuccess) throws IOException, RemoteException
RemoteInputStream
close
in interface RemoteInputStream
readSuccess
- true
iff all data was read successfully
by the client, false
otherwise
IOException
RemoteException
public byte[] readPacket(int packetId) throws IOException, RemoteException
RemoteInputStream
readPacket
in interface RemoteInputStream
packetId
- client specified id for this packet
IOException
RemoteException
public long skip(long n, int skipId) throws IOException, RemoteException
RemoteInputStream
skip
in interface RemoteInputStream
n
- the number of bytes to skipskipId
- client specified id for this skip attempt
IOException
RemoteException
public void close() throws IOException
close
in interface Closeable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |