public void writeTo(ByteBuffer buffer) { assert(buffer.hasArray()); byte[] target = buffer.array(); int offset = buffer.arrayOffset(); int pos = buffer.position(); writeToMemory(target, Platform.BYTE_ARRAY_OFFSET + offset + pos); buffer.position(pos + sizeInBytes); }
@Override public UnsafeMapData copy() { UnsafeMapData mapCopy = new UnsafeMapData(); final byte[] mapDataCopy = new byte[sizeInBytes]; Platform.copyMemory( baseObject, baseOffset, mapDataCopy, Platform.BYTE_ARRAY_OFFSET, sizeInBytes); mapCopy.pointTo(mapDataCopy, Platform.BYTE_ARRAY_OFFSET, sizeInBytes); return mapCopy; } }
final int sizeInBytes = ((UnsafeMapData) value).getSizeInBytes(); ((UnsafeMapData) value).writeToMemory(holder.buffer, holder.cursor); holder.cursor += sizeInBytes;
public final void write(UnsafeArrayData array) { // Unsafe arrays both can be written as a regular array field or as part of a map. This makes // updating the offset and size dependent on the code path, this is why we currently do not // provide an method for writing unsafe arrays that also updates the size and offset. int numBytes = array.getSizeInBytes(); grow(numBytes); Platform.copyMemory( array.getBaseObject(), array.getBaseOffset(), getBuffer(), cursor(), numBytes); increaseCursor(numBytes); }
final int sizeInBytes = ((UnsafeMapData) value).getSizeInBytes(); ((UnsafeMapData) value).writeToMemory(holder.buffer, holder.cursor); holder.cursor += sizeInBytes;
public final void write(UnsafeArrayData array) { // Unsafe arrays both can be written as a regular array field or as part of a map. This makes // updating the offset and size dependent on the code path, this is why we currently do not // provide an method for writing unsafe arrays that also updates the size and offset. int numBytes = array.getSizeInBytes(); grow(numBytes); Platform.copyMemory( array.getBaseObject(), array.getBaseOffset(), getBuffer(), cursor(), numBytes); increaseCursor(numBytes); }
@Override public UnsafeMapData copy() { UnsafeMapData mapCopy = new UnsafeMapData(); final byte[] mapDataCopy = new byte[sizeInBytes]; Platform.copyMemory( baseObject, baseOffset, mapDataCopy, Platform.BYTE_ARRAY_OFFSET, sizeInBytes); mapCopy.pointTo(mapDataCopy, Platform.BYTE_ARRAY_OFFSET, sizeInBytes); return mapCopy; } }
final int sizeInBytes = ((UnsafeMapData) value).getSizeInBytes(); ((UnsafeMapData) value).writeToMemory(holder.buffer, holder.cursor); holder.cursor += sizeInBytes;
public void writeTo(ByteBuffer buffer) { assert(buffer.hasArray()); byte[] target = buffer.array(); int offset = buffer.arrayOffset(); int pos = buffer.position(); writeToMemory(target, Platform.BYTE_ARRAY_OFFSET + offset + pos); buffer.position(pos + sizeInBytes); }
@Override public UnsafeMapData copy() { UnsafeMapData mapCopy = new UnsafeMapData(); final byte[] mapDataCopy = new byte[sizeInBytes]; Platform.copyMemory( baseObject, baseOffset, mapDataCopy, Platform.BYTE_ARRAY_OFFSET, sizeInBytes); mapCopy.pointTo(mapDataCopy, Platform.BYTE_ARRAY_OFFSET, sizeInBytes); return mapCopy; } }
public void writeTo(ByteBuffer buffer) { assert(buffer.hasArray()); byte[] target = buffer.array(); int offset = buffer.arrayOffset(); int pos = buffer.position(); writeToMemory(target, Platform.BYTE_ARRAY_OFFSET + offset + pos); buffer.position(pos + sizeInBytes); }
@Override public UnsafeMapData getMap(int ordinal) { if (isNullAt(ordinal)) { return null; } else { final long offsetAndSize = getLong(ordinal); final int offset = (int) (offsetAndSize >> 32); final int size = (int) offsetAndSize; final UnsafeMapData map = new UnsafeMapData(); map.pointTo(baseObject, baseOffset + offset, size); return map; } }
@Override public UnsafeMapData getMap(int ordinal) { if (isNullAt(ordinal)) return null; final long offsetAndSize = getLong(ordinal); final int offset = (int) (offsetAndSize >> 32); final int size = (int) offsetAndSize; final UnsafeMapData map = new UnsafeMapData(); map.pointTo(baseObject, baseOffset + offset, size); return map; }
@Override public UnsafeMapData getMap(int ordinal) { if (isNullAt(ordinal)) return null; final long offsetAndSize = getLong(ordinal); final int offset = (int) (offsetAndSize >> 32); final int size = (int) offsetAndSize; final UnsafeMapData map = new UnsafeMapData(); map.pointTo(baseObject, baseOffset + offset, size); return map; }
@Override public UnsafeMapData getMap(int ordinal) { if (isNullAt(ordinal)) return null; final long offsetAndSize = getLong(ordinal); final int offset = (int) (offsetAndSize >> 32); final int size = (int) offsetAndSize; final UnsafeMapData map = new UnsafeMapData(); map.pointTo(baseObject, baseOffset + offset, size); return map; }
@Override public UnsafeMapData getMap(int ordinal) { if (isNullAt(ordinal)) { return null; } else { final long offsetAndSize = getLong(ordinal); final int offset = (int) (offsetAndSize >> 32); final int size = (int) offsetAndSize; final UnsafeMapData map = new UnsafeMapData(); map.pointTo(baseObject, baseOffset + offset, size); return map; } }
@Override public UnsafeMapData getMap(int ordinal) { if (isNullAt(ordinal)) { return null; } else { final long offsetAndSize = getLong(ordinal); final int offset = (int) (offsetAndSize >> 32); final int size = (int) offsetAndSize; final UnsafeMapData map = new UnsafeMapData(); map.pointTo(baseObject, baseOffset + offset, size); return map; } }