@Override
            public void write(ByteBuffer src) throws IOException {
                int size = src.remaining();
                try {
                    IOUtil.writeFully(file, curOffset, src);
                } catch (Exception e) {
                    throw new IOException(String.format("name: %s", name), e);
                }
                curOffset += size;
            }
Open a writer with known incomming data size.
indexr-common/src/main/java/io/indexr/io/ByteBufferWriter.java