com.healthmarketscience.rmiio
Class GZIPRemoteOutputStream
java.lang.Object
com.healthmarketscience.rmiio.RemoteStreamServer<RemoteOutputStreamServer,RemoteOutputStream>
com.healthmarketscience.rmiio.RemoteOutputStreamServer
com.healthmarketscience.rmiio.GZIPRemoteOutputStream
- All Implemented Interfaces:
- RemoteOutputStream, Closeable, Flushable, Serializable, Remote, Unreferenced
public class GZIPRemoteOutputStream
- extends RemoteOutputStreamServer
Concrete implementation of a RemoteOutputStreamServer which expects to
receive compressed data, which it will write directly to the underlying
OutputStream.
- Author:
- James Ahlborn
- See Also:
- Usage Notes,
RemoteStreamServer.writeReplace()
,
Serialized Form
Method Summary |
protected void |
closeImpl(boolean writeSuccess)
Closes (possibly flushes) the underlying streams and cleans up any
resources. |
protected void |
flushImpl()
Flushes the underlying stream. |
boolean |
usingGZIPCompression()
Returns true if the stream is using GZIP compression over
the wire. |
protected void |
writePacket(byte[] packet)
Writes the given packet to the underlying stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GZIPRemoteOutputStream
public GZIPRemoteOutputStream(OutputStream out)
GZIPRemoteOutputStream
public GZIPRemoteOutputStream(OutputStream out,
RemoteStreamMonitor<RemoteOutputStreamServer> monitor)
usingGZIPCompression
public boolean usingGZIPCompression()
- Description copied from interface:
RemoteOutputStream
- Returns
true
if the stream is using GZIP compression over
the wire.
- Returns:
true
iff the stream data is compressed,
false
otherwise
closeImpl
protected void closeImpl(boolean writeSuccess)
throws IOException
- Description copied from class:
RemoteStreamServer
- Closes (possibly flushes) the underlying streams and cleans up any
resources. Called by the finish() method.
- Overrides:
closeImpl
in class RemoteOutputStreamServer
- Parameters:
writeSuccess
- true
iff all data was successfully
transferred, false
otherwise
- Throws:
IOException
flushImpl
protected void flushImpl()
throws IOException
- Description copied from class:
RemoteOutputStreamServer
- Flushes the underlying stream.
- Specified by:
flushImpl
in class RemoteOutputStreamServer
- Throws:
IOException
writePacket
protected void writePacket(byte[] packet)
throws IOException
- Description copied from class:
RemoteOutputStreamServer
- Writes the given packet to the underlying stream. If this stream is
using compression, this packet should contain compressed data.
- Specified by:
writePacket
in class RemoteOutputStreamServer
- Throws:
IOException
Copyright © 2006–2016 Health Market Science. All rights reserved.