private int tryEnsureBatchSize(int length) { ensureWritableBytes(min(MAX_UNUSED_BUFFER_SIZE, length)); return min(length, slice.length() - bufferPosition); }
@Override public void writeInt(int value) { ensureWritableBytes(SIZE_OF_INT); slice.setInt(bufferPosition, value); bufferPosition += SIZE_OF_INT; }
@Override public void writeLong(long value) { ensureWritableBytes(SIZE_OF_LONG); slice.setLong(bufferPosition, value); bufferPosition += SIZE_OF_LONG; }
@Override public void writeShort(int value) { ensureWritableBytes(SIZE_OF_SHORT); slice.setShort(bufferPosition, value); bufferPosition += SIZE_OF_SHORT; }
@Override public void writeInt(int value) { ensureWritableBytes(SIZE_OF_INT); slice.setInt(bufferPosition, value); bufferPosition += SIZE_OF_INT; }
@Override public void writeLong(long value) { ensureWritableBytes(SIZE_OF_LONG); slice.setLong(bufferPosition, value); bufferPosition += SIZE_OF_LONG; }
@Override public void writeByte(int value) { ensureWritableBytes(SIZE_OF_BYTE); slice.setByte(bufferPosition, value); bufferPosition += SIZE_OF_BYTE; }
@Override public void writeShort(int value) { ensureWritableBytes(SIZE_OF_SHORT); slice.setShort(bufferPosition, value); bufferPosition += SIZE_OF_SHORT; }
@Override public void writeByte(int value) { ensureWritableBytes(SIZE_OF_BYTE); slice.setByte(bufferPosition, value); bufferPosition += SIZE_OF_BYTE; }
private int tryEnsureBatchSize(int length) { ensureWritableBytes(min(MAX_UNUSED_BUFFER_SIZE, length)); return min(length, slice.length() - bufferPosition); }