public long length() { return tailOffset(memory) + buffer.position(); }
public long length() { return tailOffset(memory) + buffer.position(); }
public long length() { return tailOffset(memory) + buffer.position(); }
public long length() { return tailOffset(memory) + buffer.position(); }
private static ByteBuffer tailBuffer(Memory memory) { return memory.asByteBuffer(tailOffset(memory), (int) Math.min(memory.size, Integer.MAX_VALUE)); } }
private static ByteBuffer tailBuffer(Memory memory) { return memory.asByteBuffer(tailOffset(memory), (int) Math.min(memory.size, Integer.MAX_VALUE)); } }
private static ByteBuffer tailBuffer(Memory memory) { return memory.asByteBuffer(tailOffset(memory), (int) Math.min(memory.size, Integer.MAX_VALUE)); } }
private static ByteBuffer tailBuffer(Memory memory) { return memory.asByteBuffer(tailOffset(memory), (int) Math.min(memory.size, Integer.MAX_VALUE)); } }
@Override protected void reallocate(long count) { long newCapacity = calculateNewSize(count); if (newCapacity != capacity()) { long position = length(); ByteOrder order = buffer.order(); SafeMemory oldBuffer = memory; memory = this.memory.copy(newCapacity); buffer = tailBuffer(memory); int newPosition = (int) (position - tailOffset(memory)); buffer.position(newPosition); buffer.order(order); oldBuffer.free(); } }
@Override protected void reallocate(long count) { long newCapacity = calculateNewSize(count); if (newCapacity != capacity()) { long position = length(); ByteOrder order = buffer.order(); SafeMemory oldBuffer = memory; memory = this.memory.copy(newCapacity); buffer = tailBuffer(memory); int newPosition = (int) (position - tailOffset(memory)); buffer.position(newPosition); buffer.order(order); oldBuffer.free(); } }
@Override protected void reallocate(long count) { long newCapacity = calculateNewSize(count); if (newCapacity != capacity()) { long position = length(); ByteOrder order = buffer.order(); SafeMemory oldBuffer = memory; memory = this.memory.copy(newCapacity); buffer = tailBuffer(memory); int newPosition = (int) (position - tailOffset(memory)); buffer.position(newPosition); buffer.order(order); oldBuffer.free(); } }
@Override protected void reallocate(long count) { long newCapacity = calculateNewSize(count); if (newCapacity != capacity()) { long position = length(); ByteOrder order = buffer.order(); SafeMemory oldBuffer = memory; memory = this.memory.copy(newCapacity); buffer = tailBuffer(memory); int newPosition = (int) (position - tailOffset(memory)); buffer.position(newPosition); buffer.order(order); oldBuffer.free(); } }