xref: /aosp_15_r20/external/jackson-databind/src/test/java/perf/NopOutputStream.java (revision 0ed15c778abdfe0f5f51f6133673e1619d6e56e4)
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