@Test public void testSkip() throws IOException { int skipAmount = (int) (BLOCK_LENGTH / 2); int readAmount = (int) (BLOCK_LENGTH * 2); byte[] buffer = new byte[readAmount]; mTestStream.skip(skipAmount); mTestStream.read(buffer); assertArrayEquals(BufferUtils.getIncreasingByteArray(skipAmount, readAmount), buffer); assertEquals(0, mTestStream.skip(0)); assertEquals(BLOCK_LENGTH / 2, mTestStream.skip(BLOCK_LENGTH / 2)); assertEquals(BufferUtils.byteToInt((byte) (BLOCK_LENGTH * 3)), mTestStream.read()); }
@Override public long skip(long n) throws IOException { if (n <= 0) { return 0; } long toSkip = Math.min(n, mLength - mPosition); seek(mPosition + toSkip); return toSkip; }
AlluxioFileInStream extends FileInStream { @Override public long skip(long n) throws IOException { if (n <= 0) { return 0; } long toSkip = Math.min(n, mLength - mPosition); seek(mPosition + toSkip); return toSkip; } }
AlluxioFileInStream extends FileInStream { @Override public long skip(long n) throws IOException { if (n <= 0) { return 0; } long toSkip = Math.min(n, mLength - mPosition); seek(mPosition + toSkip); return toSkip; } protected  AlluxioFileInStream(URIStatus status, InStreamOptions options,
      FileSystemContext context); }
AlluxioFileInStream extends FileInStream { @Override public long skip(long n) throws IOException { if (n <= 0) { return 0; } long toSkip = Math.min(n, mLength - mPosition); seek(mPosition + toSkip); return toSkip; } protected  AlluxioFileInStream(URIStatus status, InStreamOptions options,
      FileSystemContext context); @Override int read(); @Override int read(byte[] b); @Override int read(byte[] b, int off, int len); @Override long skip(long n); @Override void close(); @Override long remaining(); @Override int positionedRead(long pos, byte[] b, int off, int len); @Override long getPos(); @Override void seek(long pos); }
AlluxioFileInStream extends FileInStream { @Override public long skip(long n) throws IOException { if (n <= 0) { return 0; } long toSkip = Math.min(n, mLength - mPosition); seek(mPosition + toSkip); return toSkip; } protected  AlluxioFileInStream(URIStatus status, InStreamOptions options,
      FileSystemContext context); @Override int read(); @Override int read(byte[] b); @Override int read(byte[] b, int off, int len); @Override long skip(long n); @Override void close(); @Override long remaining(); @Override int positionedRead(long pos, byte[] b, int off, int len); @Override long getPos(); @Override void seek(long pos);  }