long address = bytes.addressForWrite(bytes.writePosition()); long bstart = bytes.start(); long bcap = bytes.realCapacity(); long canWrite = bcap - (bytes.writePosition() - bstart); long lengthCount = batchAppender.writeMessages(address, canWrite, writeCount); bytes.writeSkip((int) lengthCount);
if (wire != null && writeCount > 0) { MappedBytes bytes = (MappedBytes) wire.bytes(); long address = bytes.addressForWrite(bytes.writePosition()); long bstart = bytes.start(); long bcap = bytes.realCapacity(); long canWrite = bcap - (bytes.writePosition() - bstart); long lengthCount = writeMessages(address, canWrite, writeCount); bytes.writeSkip((int) lengthCount);
mappedBytes.writePosition(mappedBytes.readPosition()); long pos = recovery.writeHeader(mappedWire, safeLength, timeoutMS, null, null); LongValue longValue = wireType.newLongReference().get();
public long rawCopy(@NotNull BytesStore bytes, long offset, long length) throws BufferOverflowException, BufferUnderflowException { assert length < safeCopySize(); this.acquireNextByteStore(writePosition(), false); long len = Math.min(writeRemaining(), Math.min(bytes.readRemaining(), length)); if (len > 0) { OS.memory().copyMemory(bytes.addressForRead(offset), addressForWrite(writePosition()), len); uncheckedWritePosition(writePosition() + len); } return len; }
@NotNull @Override public Bytes<Void> append8bit(@NotNull CharSequence cs, int start, int end) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException { assert singleThreadedAccess(); // check the start. long pos = writePosition(); writeCheckOffset(pos, 0); if (!(cs instanceof String) || pos + (end - start) * 3 + 5 >= safeLimit()) { return super.append8bit(cs, start, end); } return append8bit0((String) cs, start, end - start); }
@Override @NotNull public MappedBytes write8bit(CharSequence s, int start, int length) { assert singleThreadedAccess(); if (s == null) { writeStopBit(-1); return this; } // check the start. long pos = writePosition(); writeCheckOffset(pos, 0); if (!(s instanceof String) || pos + length * 3 + 5 >= safeLimit()) { super.write8bit(s, start, length); return this; } writeStopBit(length); return append8bit0((String) s, start, length); }
if (Jvm.isJava9Plus()) { byte[] bytes = extractBytes(s); long address = addressForWrite(writePosition()); Memory memory = bytesStore().memory; int i = 0; } else { char[] chars = extractChars(s); long address = addressForWrite(writePosition()); Memory memory = bytesStore().memory; int i = 0;
long address = bytes.addressForWrite(bytes.writePosition()); long bstart = bytes.start(); long bcap = bytes.realCapacity(); long canWrite = bcap - (bytes.writePosition() - bstart); long lengthCount = batchAppender.writeMessages(address, canWrite, writeCount); bytes.writeSkip((int) lengthCount);
assert singleThreadedAccess(); long pos = writePosition(); writeCheckOffset(pos, 0); if (!(cs instanceof String) || pos + length * 3 + 5 >= safeLimit()) {
mappedBytes.writePosition(mappedBytes.readPosition()); long pos = recovery.writeHeader(mappedWire, safeLength, timeoutMS, null, null); LongValue longValue = wireType.newLongReference().get();