@Test public void givenZeroToSkip_whenIWriteInt_thenIGetIntInOutput() throws Exception { SkippingOutputStream testSubject = new SkippingOutputStream(0, outputStream); testSubject.write(0); assertEquals(1, outputStream.toByteArray().length); assertEquals(0, outputStream.toByteArray()[0]); }
public void write(int b) throws IOException { if (toSkip > 0) { toSkip--; } else { out.write(b); } }
SkippingOutputStream extends FilterOutputStream { public void write(int b) throws IOException { if (toSkip > 0) { toSkip--; } else { out.write(b); } } }
SkippingOutputStream extends FilterOutputStream { public void write(int b) throws IOException { if (toSkip > 0) { toSkip--; } else { out.write(b); } } SkippingOutputStream(long toSkip, OutputStream wrapped); }
SkippingOutputStream extends FilterOutputStream { public void write(int b) throws IOException { if (toSkip > 0) { toSkip--; } else { out.write(b); } } SkippingOutputStream(long toSkip, OutputStream wrapped); void write(int b); void write(byte[] b); void write(byte[] b, int off, int len); }
SkippingOutputStream extends FilterOutputStream { public void write(int b) throws IOException { if (toSkip > 0) { toSkip--; } else { out.write(b); } } SkippingOutputStream(long toSkip, OutputStream wrapped); void write(int b); void write(byte[] b); void write(byte[] b, int off, int len);  }