1 package perf; 2 3 import java.io.IOException; 4 import java.io.OutputStream; 5 6 public class NopOutputStream extends OutputStream 7 { 8 protected int size = 0; 9 NopOutputStream()10 public NopOutputStream() { } 11 12 @Override write(int b)13 public void write(int b) throws IOException { ++size; } 14 15 @Override write(byte[] b)16 public void write(byte[] b) throws IOException { size += b.length; } 17 18 @Override write(byte[] b, int offset, int len)19 public void write(byte[] b, int offset, int len) throws IOException { size += len; } 20 size()21 public int size() { return size; } 22 } 23