@Test public void append() throws Exception { ByteBuffer buf = BufferUtils.getIncreasingByteBuffer(TEST_BLOCK_SIZE); Assert.assertEquals(TEST_BLOCK_SIZE, mWriter.append(buf)); Assert.assertEquals(TEST_BLOCK_SIZE, mWriter.append(buf)); mWriter.close(); Assert.assertEquals(2 * TEST_BLOCK_SIZE, new File(mTestFilePath).length()); ByteBuffer result = ByteBuffer.wrap(Files.readAllBytes(Paths.get(mTestFilePath))); result.position(0).limit(TEST_BLOCK_SIZE); BufferUtils.equalIncreasingByteBuffer(0, TEST_BLOCK_SIZE, result.slice()); result.position(TEST_BLOCK_SIZE).limit(TEST_BLOCK_SIZE * 2); BufferUtils.equalIncreasingByteBuffer(0, TEST_BLOCK_SIZE, result.slice()); }
@Override public long append(ByteBuffer inputBuf) throws IOException { long bytesWritten = write(mLocalFileChannel.size(), inputBuf.duplicate()); mPosition += bytesWritten; return bytesWritten; }
LocalFileBlockWriter extends BlockWriter { @Override public long append(ByteBuffer inputBuf) throws IOException { long bytesWritten = write(mLocalFileChannel.size(), inputBuf.duplicate()); mPosition += bytesWritten; return bytesWritten; } }
LocalFileBlockWriter extends BlockWriter { @Override public long append(ByteBuffer inputBuf) throws IOException { long bytesWritten = write(mLocalFileChannel.size(), inputBuf.duplicate()); mPosition += bytesWritten; return bytesWritten; } LocalFileBlockWriter(String path); }
LocalFileBlockWriter extends BlockWriter { @Override public long append(ByteBuffer inputBuf) throws IOException { long bytesWritten = write(mLocalFileChannel.size(), inputBuf.duplicate()); mPosition += bytesWritten; return bytesWritten; } LocalFileBlockWriter(String path); @Override long append(ByteBuffer inputBuf); @Override long append(ByteBuf buf); @Override long append(DataBuffer buffer); @Override long getPosition(); @Override WritableByteChannel getChannel(); @Override void close(); }
LocalFileBlockWriter extends BlockWriter { @Override public long append(ByteBuffer inputBuf) throws IOException { long bytesWritten = write(mLocalFileChannel.size(), inputBuf.duplicate()); mPosition += bytesWritten; return bytesWritten; } LocalFileBlockWriter(String path); @Override long append(ByteBuffer inputBuf); @Override long append(ByteBuf buf); @Override long append(DataBuffer buffer); @Override long getPosition(); @Override WritableByteChannel getChannel(); @Override void close();  }