opendap.servlet
Class DummySink

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.util.zip.DeflaterOutputStream
              extended by opendap.servlet.DummySink
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class DummySink
extends java.util.zip.DeflaterOutputStream

The Servlet to exercise what's available.

Author:
Nathan David Potter

Field Summary
 
Fields inherited from class java.util.zip.DeflaterOutputStream
buf, def
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
DummySink(java.io.OutputStream out)
          Creates a new output stream with a defaul compressor and buffer size.
DummySink(java.io.OutputStream out, java.util.zip.Deflater def)
          Creates a new output stream with the specified compressor and a default buffer size.
DummySink(java.io.OutputStream out, java.util.zip.Deflater def, int size)
          Creates a new output stream with the specified compressor and buffer size.
 
Method Summary
 void close()
           
 void flush()
           
 int getCount()
           
 void resetCount()
           
 void setCount(int c)
           
 void write(byte[] b, int off, int len)
          Writes an array of bytes to the compressed output stream.
 void write(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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummySink

public DummySink(java.io.OutputStream out,
                 java.util.zip.Deflater def,
                 int size)
Creates a new output stream with the specified compressor and buffer size.

Parameters:
out - the output stream
def - the compressor ("deflater")
Throws:
java.lang.IllegalArgumentException - if size is <= 0

DummySink

public DummySink(java.io.OutputStream out,
                 java.util.zip.Deflater def)
Creates a new output stream with the specified compressor and a default buffer size.

Parameters:
out - the output stream
def - the compressor ("deflater")

DummySink

public DummySink(java.io.OutputStream out)
Creates a new output stream with a defaul compressor and buffer size.

Method Detail

close

public void close()
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.util.zip.DeflaterOutputStream

flush

public void flush()
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.FilterOutputStream

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.util.zip.DeflaterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Writes an array of bytes to the compressed output stream. This method will block until all the bytes are written.

Overrides:
write in class java.util.zip.DeflaterOutputStream
Parameters:
off - the start offset of the data
len - the length of the data
Throws:
java.io.IOException - if an I/O error has occurred

getCount

public int getCount()

setCount

public void setCount(int c)

resetCount

public void resetCount()