@NotNull R write(long offsetInRDO, byte[] bytes, int offset, int length) throws BufferOverflowException;
while (decimalPlaces-- > digits) out.writeUnsignedByte(offset++, '0'); out.write(offset++, numberBuffer, endIndex, digits); return; } else { out.write(offset, numberBuffer, endIndex, decimalLength); offset += decimalLength; out.writeUnsignedByte(offset++, '.'); out.write(offset++, numberBuffer, endIndex + decimalLength, digits - decimalLength);
@NotNull R write(long writeOffset, RandomDataInput bytes, long readOffset, long length) throws BufferOverflowException, BufferUnderflowException;
/** * Writes bytes of this {@code Data} to the given {@code target} from the given {@code * targetOffset}. * <p> * <p>Default implementation copies {@link #bytes()} of this {@code Data} using standard IO * methods of {@code RandomDataInput} and {@code RandomDataOutput}, but custom implementation * may write directly from {@linkplain #get() object}, if this {@code Data} is object-based and * obtaining {@link #bytes()} requires serialization internally. This allows to avoid double * copy. * * @param target the destination to write this data bytes to * @param targetOffset the offset in the target, to write the bytes from. */ default void writeTo(RandomDataOutput target, long targetOffset) { target.write(targetOffset, Objects.requireNonNull(bytes()), offset(), size()); }
@Override public void writeTo(RandomDataOutput target, long targetOffset) { if (bytesInit || !(target instanceof BytesStore)) { target.write(targetOffset, bytes(), offset(), size); } else { targetBytes.bytesStore((BytesStore) target, targetOffset, size); targetBytes.writePosition(targetOffset); sizedWriter.write(targetBytes, size, instance); targetBytes.bytesStore(NoBytesStore.NO_BYTES_STORE, 0, 0); } }
@Override public void writeTo(RandomDataOutput target, long targetOffset) { if (bytesInit) { target.write(targetOffset, bytes(), offset(), size()); } else { targetBytes.bytesStore((BytesStore) target, targetOffset, target.capacity() - targetOffset); targetBytes.writePosition(targetOffset); instance.writeMarshallable(targetBytes); targetBytes.bytesStore(NoBytesStore.NO_BYTES_STORE, 0, 0); } }