@Override public void close() throws IOException { if (bs != null) { InputStream i = new ByteArrayInputStream(bs.getBuffer()); bs = null; is.close(); is = i; } }
@Override public int read() throws IOException { int r = is.read(); if (bs != null) bs.write(r); return r; }
RereadInputStream(InputStream is) { this.is = is; this.bs = new ByteStream(); }
RereadInputStream(InputStream is) { this.is = is; this.bs = new ByteStream(); }
RereadInputStream(InputStream is) { this.is = is; this.bs = new ByteStream(); }
@Override public int read(byte[] b) throws IOException { int r = is.read(b); if (r > 0 && bs != null) bs.write(b, 0, r); return r; }
@Override public int read(byte[] b, int off, int len) throws IOException { int r = is.read(b, off, len); if (r > 0 && bs != null) bs.write(b, off, r); return r; }
@Override public int read() throws IOException { int r = is.read(); if (bs != null) bs.write(r); return r; }
@Override public int read(byte[] b) throws IOException { int r = is.read(b); if (r > 0 && bs != null) bs.write(b, 0, r); return r; }
RereadInputStream(InputStream is) { this.is = is; this.bs = new ByteStream(); }
@Override public void close() throws IOException { if (bs != null) { InputStream i = new ByteArrayInputStream(bs.getBuffer()); bs = null; is.close(); is = i; } }
@Override public void close() throws IOException { if (bs != null) { InputStream i = new ByteArrayInputStream(bs.getBuffer()); bs = null; is.close(); is = i; } }
@Override public int read(byte[] b) throws IOException { int r = is.read(b); if (r > 0 && bs != null) bs.write(b, 0, r); return r; }
@Override public int read(byte[] b, int off, int len) throws IOException { int r = is.read(b, off, len); if (r > 0 && bs != null) bs.write(b, off, r); return r; }
@Override public void close() throws IOException { if (bs != null) { InputStream i = new ByteArrayInputStream(bs.getBuffer()); bs = null; is.close(); is = i; } }
@Override public int read(byte[] b) throws IOException { int r = is.read(b); if (r > 0 && bs != null) bs.write(b, 0, r); return r; }
@Override public int read() throws IOException { int r = is.read(); if (bs != null) bs.write(r); return r; }
@Override public int read(byte[] b, int off, int len) throws IOException { int r = is.read(b, off, len); if (r > 0 && bs != null) bs.write(b, off, r); return r; }
@Override public int read(byte[] b, int off, int len) throws IOException { int r = is.read(b, off, len); if (r > 0 && bs != null) bs.write(b, off, r); return r; }
@Override public int read() throws IOException { int r = is.read(); if (bs != null) bs.write(r); return r; }