public class RpcInflaterOutputStream
extends java.io.FilterOutputStream
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buf
Output buffer for writing uncompressed data.
|
protected java.util.zip.Inflater |
inf
Decompressor for this stream.
|
Constructor and Description |
---|
RpcInflaterOutputStream(java.io.OutputStream out,
java.util.zip.Inflater infl,
int bufLen,
MD5Digester digester)
Creates a new output stream with the specified decompressor and
buffer size.
|
RpcInflaterOutputStream(java.io.OutputStream out,
java.util.zip.Inflater infl,
MD5Digester digester)
Creates a new output stream with the specified decompressor and a
default buffer size.
|
RpcInflaterOutputStream(java.io.OutputStream out,
MD5Digester digester)
Creates a new output stream with a default decompressor and buffer
size.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Writes any remaining uncompressed data to the output stream and closes
the underlying output stream.
|
void |
finish()
Finishes writing uncompressed data to the output stream without closing
the underlying stream.
|
void |
flush()
Flushes this output stream, forcing any pending buffered output bytes to be
written.
|
long |
getBytesWritten() |
MD5Digester |
getLocalDigester() |
void |
setLocalDigester(MD5Digester localDigester) |
void |
write(byte[] b,
int off,
int len)
Writes an array of bytes to the uncompressed output stream.
|
void |
write(int b)
Writes a byte to the uncompressed output stream.
|
protected final java.util.zip.Inflater inf
protected final byte[] buf
public RpcInflaterOutputStream(java.io.OutputStream out, MD5Digester digester)
out
- output stream to write the uncompressed data todigester
- m5d digesterjava.lang.NullPointerException
- if out
is nullpublic RpcInflaterOutputStream(java.io.OutputStream out, java.util.zip.Inflater infl, MD5Digester digester)
out
- output stream to write the uncompressed data toinfl
- decompressor ("inflater") for this streamdigester
- m5d digesterjava.lang.NullPointerException
- if out
or infl
is nullpublic RpcInflaterOutputStream(java.io.OutputStream out, java.util.zip.Inflater infl, int bufLen, MD5Digester digester)
out
- output stream to write the uncompressed data toinfl
- decompressor ("inflater") for this streambufLen
- decompression buffer sizedigester
- m5d digesterjava.lang.IllegalArgumentException
- if bufLen
is <= 0java.lang.NullPointerException
- if out
or infl
is nullpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.FilterOutputStream
java.io.IOException
- if an I/O error occurspublic void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.FilterOutputStream
java.io.IOException
- if an I/O error occurs or this stream is already
closedpublic void finish() throws java.io.IOException
java.io.IOException
- if an I/O error occurs or this stream is already
closedpublic void write(int b) throws java.io.IOException
write
in class java.io.FilterOutputStream
b
- a single byte of compressed data to decompress and write to
the output streamjava.io.IOException
- if an I/O error occurs or this stream is already
closedjava.util.zip.ZipException
- if a compression (ZIP) format error occurspublic void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.FilterOutputStream
b
- buffer containing compressed data to decompress and write to
the output streamoff
- starting offset of the compressed data within b
len
- number of bytes to decompress from b
java.lang.IndexOutOfBoundsException
- if off
< 0, or if
len
< 0, or if len
> b.length - off
java.io.IOException
- if an I/O error occurs or this stream is already
closedjava.lang.NullPointerException
- if b
is nulljava.util.zip.ZipException
- if a compression (ZIP) format error occurspublic MD5Digester getLocalDigester()
public void setLocalDigester(MD5Digester localDigester)
public long getBytesWritten()