Java Code Examples for net.openhft.chronicle.bytes.BytesStore#write()

The following examples show how to use net.openhft.chronicle.bytes.BytesStore#write() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InMemoryLongColumn.java    From Chronicle-TimeSeries with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void ensureCapacity(long capacity) {
    long cap = lookup.sizeFor(capacity);
    if (cap > bytes.realCapacity()) {
        long value = lookup.sizeFor(capacity);
        BytesStore bytes2 = Jvm.isDebug()
                ? Bytes.wrapForRead(ByteBuffer.allocateDirect(Math.toIntExact(value)))
                : NativeBytesStore.lazyNativeBytesStoreWithFixedCapacity(value);
        bytes2.write(0, bytes);
        bytes.release();
        bytes = bytes2;
    }
}
 
Example 2
Source File: InMemoryDoubleColumn.java    From Chronicle-TimeSeries with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
    public void ensureCapacity(long capacity) {
        long cap = lookup.sizeFor(capacity);
        if (cap > bytes.realCapacity()) {
//            BytesStore bytes2 = NativeBytesStore.lazyNativeBytesStoreWithFixedCapacity(Maths.divideRoundUp(cap, OS.pageSize()));
            BytesStore bytes2 = Bytes.wrapForRead(ByteBuffer.allocateDirect(Math.toIntExact(lookup.sizeFor(capacity))));
            bytes2.write(0, bytes);
            bytes.release();
            bytes = bytes2;
        }
    }
 
Example 3
Source File: SbeBufferImpl.java    From java-cme-mdp3-handler with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void copyTo(final BytesStore<?, ?> store) {
    store.write(0, this.bytes, 0, this.length());
}
 
Example 4
Source File: SbeBufferImpl.java    From java-cme-mdp3-handler with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void copyTo(final int offset, final BytesStore<?, ?> store, final int len) {
    store.write(0, this.bytes, offset, len);
}