@Override
  public long remaining() {
    return mLength - mPosition;
  }
@Test
  public void remaining() throws IOException, AlluxioException {
    AlluxioURI ufsPath = getUfsPath();
    createFile(ufsPath, CHUNK_SIZE);
    try (FileInStream inStream = getStream(ufsPath)) {
      assertEquals(CHUNK_SIZE, inStream.remaining());
      assertEquals(0, inStream.read());
      assertEquals(CHUNK_SIZE - 1, inStream.remaining());
      int len = CHUNK_SIZE / 2;
      assertEquals(len, inStream.read(new byte[len], 0, len));
      assertEquals(CHUNK_SIZE - len - 1, inStream.remaining());
      len = CHUNK_SIZE / 4;
      inStream.read(ByteBuffer.allocate(len), 0, len);
      assertEquals(CHUNK_SIZE / 4 - 1, inStream.remaining());
    }
  }