@Test public void readReadsFromNextWithBytes() throws Exception { ResumableInputStream in = new ResumableInputStream(new TestingInputStream(1, 2, -1, -1), new SimpleReopener(null)); assertThat(in.read(new byte[1]), is(1)); assertThat(in.read(new byte[1]), is(2)); assertThat(in.read(new byte[1]), is(-1)); assertThat(in.read(new byte[1]), is(-1)); }
@Override public int read() throws IOException { while (true) { try { int v = in.read(); if (v >= 0) { offset += 1; } return v; } catch (IOException | RuntimeException ex) { reopen(ex); } } }
ResumableInputStream extends InputStream { @Override public int read() throws IOException { while (true) { try { int v = in.read(); if (v >= 0) { offset += 1; } return v; } catch (IOException | RuntimeException ex) { reopen(ex); } } } }
ResumableInputStream extends InputStream { @Override public int read() throws IOException { while (true) { try { int v = in.read(); if (v >= 0) { offset += 1; } return v; } catch (IOException | RuntimeException ex) { reopen(ex); } } } ResumableInputStream(InputStream initialInputStream, Reopener reopener);  ResumableInputStream(Reopener reopener); }
ResumableInputStream extends InputStream { @Override public int read() throws IOException { while (true) { try { int v = in.read(); if (v >= 0) { offset += 1; } return v; } catch (IOException | RuntimeException ex) { reopen(ex); } } } ResumableInputStream(InputStream initialInputStream, Reopener reopener);  ResumableInputStream(Reopener reopener); @Override int read(); @Override int read(byte[] b); @Override int read(byte[] b, int off, int len); @Override long skip(long n); @Override int available(); @Override void close(); }
ResumableInputStream extends InputStream { @Override public int read() throws IOException { while (true) { try { int v = in.read(); if (v >= 0) { offset += 1; } return v; } catch (IOException | RuntimeException ex) { reopen(ex); } } } ResumableInputStream(InputStream initialInputStream, Reopener reopener);  ResumableInputStream(Reopener reopener); @Override int read(); @Override int read(byte[] b); @Override int read(byte[] b, int off, int len); @Override long skip(long n); @Override int available(); @Override void close();  }