NullOutputStream.java

  1. package gov.usgs.earthquake.util;

  2. import java.io.IOException;
  3. import java.io.OutputStream;

  4. /**
  5.  * Stream that ignores any written bytes.
  6.  */
  7. public class NullOutputStream extends OutputStream {

  8.     public void write(byte[] b) {
  9.         // override this method to avoid wasted call overhead.
  10.     }

  11.     public void write(byte[] b, int off, int len) {
  12.         // override this method to avoid wasted call overhead.
  13.     }

  14.     public void write(int b) throws IOException {
  15.         // override this method to avoid wasted call overhead.
  16.     }

  17. }