@Test public void givenZeroToSkip_whenIWriteArrayRange_thenIGetArrayRangeInOutput() throws Exception { byte[] expected = new byte[]{1, 2, 3, 4, 5}; SkippingOutputStream testSubject = new SkippingOutputStream(0, outputStream); testSubject.write(expected, 1, 3); assertEquals(3, outputStream.toByteArray().length); assertArrayEquals(new byte[]{2, 3, 4}, outputStream.toByteArray()); }
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);  }