@Test public void readBytesWithOffsetAndLength() throws IOException { bytesRead = in.read(buf, 2, 23); Assert.assertEquals(7, bytesRead); Assert.assertArrayEquals(firstBytes, Arrays.copyOfRange(buf, 2, 2 + bytesRead)); bytesRead = in.read(buf, 13, 45); Assert.assertEquals(5, bytesRead); Assert.assertArrayEquals(secondBytes, Arrays.copyOfRange(buf, 13, 13 + bytesRead)); }
@Override public int read() throws IOException { if (readEOT) { readEOT = false; return -1; } int l = in.read(); if (l == EOT) { readEOT = true; } return l; }
EndOfTransmissionInputStream extends InputStream { @Override public int read() throws IOException { if (readEOT) { readEOT = false; return -1; } int l = in.read(); if (l == EOT) { readEOT = true; } return l; } }
EndOfTransmissionInputStream extends InputStream { @Override public int read() throws IOException { if (readEOT) { readEOT = false; return -1; } int l = in.read(); if (l == EOT) { readEOT = true; } return l; } EndOfTransmissionInputStream(InputStream in); }
EndOfTransmissionInputStream extends InputStream { @Override public int read() throws IOException { if (readEOT) { readEOT = false; return -1; } int l = in.read(); if (l == EOT) { readEOT = true; } return l; } EndOfTransmissionInputStream(InputStream in); @Override int read(); }
EndOfTransmissionInputStream extends InputStream { @Override public int read() throws IOException { if (readEOT) { readEOT = false; return -1; } int l = in.read(); if (l == EOT) { readEOT = true; } return l; } EndOfTransmissionInputStream(InputStream in); @Override int read();  }