Package opendap.servlet
Class DummySink
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.util.zip.DeflaterOutputStream
-
- opendap.servlet.DummySink
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class DummySink extends DeflaterOutputStream
The Servlet to exercise what's available.
-
-
Field Summary
-
Fields inherited from class java.util.zip.DeflaterOutputStream
buf, def
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description DummySink(OutputStream out)Creates a new output stream with a defaul compressor and buffer size.DummySink(OutputStream out, Deflater def)Creates a new output stream with the specified compressor and a default buffer size.DummySink(OutputStream out, Deflater def, int size)Creates a new output stream with the specified compressor and buffer size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()intgetCount()voidresetCount()voidsetCount(int c)voidwrite(byte[] b, int off, int len)Writes an array of bytes to the compressed output stream.voidwrite(int b)-
Methods inherited from class java.util.zip.DeflaterOutputStream
deflate, finish
-
Methods inherited from class java.io.FilterOutputStream
write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
DummySink
public DummySink(OutputStream out, Deflater def, int size)
Creates a new output stream with the specified compressor and buffer size.- Parameters:
out- the output streamdef- the compressor ("deflater")- Throws:
IllegalArgumentException- if size is<= 0
-
DummySink
public DummySink(OutputStream out, Deflater def)
Creates a new output stream with the specified compressor and a default buffer size.- Parameters:
out- the output streamdef- the compressor ("deflater")
-
DummySink
public DummySink(OutputStream out)
Creates a new output stream with a defaul compressor and buffer size.
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classDeflaterOutputStream
-
flush
public void flush()
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classDeflaterOutputStream
-
write
public void write(int b) throws IOException- Overrides:
writein classDeflaterOutputStream- Throws:
IOException
-
write
public void write(byte[] b, int off, int len) throws IOExceptionWrites an array of bytes to the compressed output stream. This method will block until all the bytes are written.- Overrides:
writein classDeflaterOutputStream- Parameters:
off- the start offset of the datalen- the length of the data- Throws:
IOException- if an I/O error has occurred
-
getCount
public int getCount()
-
setCount
public void setCount(int c)
-
resetCount
public void resetCount()
-
-