@Test public void testSkip() throws Exception { InputStream r = new TextInputStream("test", Charsets.UTF_8, 1024); r.skip(1); r.skip(2); Assert.assertEquals('t', r.read()); r.skip(100); Assert.assertEquals(-1, r.read()); r.close(); }
@Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; }
TextInputStream extends InputStream { @Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; } }
TextInputStream extends InputStream { @Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; } TextInputStream(final CharSequence s, final Charset charset, int bufferSize); }
TextInputStream extends InputStream { @Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; } TextInputStream(final CharSequence s, final Charset charset, int bufferSize); @Override int read(byte[] b, int off, int len); @Override int read(); @Override int read(byte[] b); @Override long skip(long n); @Override int available(); @Override void mark(int readlimit); @Override void reset(); @Override boolean markSupported(); @Override void close(); }
TextInputStream extends InputStream { @Override public long skip(long n) throws IOException { int skipped = 0; while (n > 0 && this.cbuf.hasRemaining()) { this.cbuf.get(); n--; skipped++; } return skipped; } TextInputStream(final CharSequence s, final Charset charset, int bufferSize); @Override int read(byte[] b, int off, int len); @Override int read(); @Override int read(byte[] b); @Override long skip(long n); @Override int available(); @Override void mark(int readlimit); @Override void reset(); @Override boolean markSupported(); @Override void close();  }