@Override public void writeBoolean(boolean v) { write(v ? 'Y' : 0); }
@Override public void write(@NotNull byte[] bytes) { write(bytes, 0, bytes.length); }
@Override public void writeBytes(@NotNull String s) { int len = s.length(); for (int i = 0; i < len; i++) write(s.charAt(i)); }
@Override public void writeBytes(@NotNull String s) { int len = s.length(); for (int i = 0; i < len; i++) write(s.charAt(i)); }
private void appendLong0(long num) { // Extract digits into the end of the numberBuffer int endIndex = appendLong1(num); // Bulk copy the digits into the front of the buffer write(numberBuffer, endIndex, MAX_NUMBER_LENGTH - endIndex); }
private void appendDouble0(long num, int precision) { // Extract digits into the end of the numberBuffer // Once desired precision is reached, write the '.' int endIndex = appendDouble1(num, precision); // Bulk copy the digits into the front of the buffer // TODO: Can this be avoided with use of correctly offset bulk appends on Excerpt? // Uses (numberBufferIdx - 1) because index was advanced one too many times write(numberBuffer, endIndex, MAX_NUMBER_LENGTH - endIndex); }
private void appendLong0(long num) { // Extract digits into the end of the numberBuffer int endIndex = appendLong1(num); // Bulk copy the digits into the front of the buffer write(numberBuffer, endIndex, MAX_NUMBER_LENGTH - endIndex); }
private void appendDouble0(long num, int precision) { // Extract digits into the end of the numberBuffer // Once desired precision is reached, write the '.' int endIndex = appendDouble1(num, precision); // Bulk copy the digits into the front of the buffer // TODO: Can this be avoided with use of correctly offset bulk appends on Excerpt? // Uses (numberBufferIdx - 1) because index was advanced one too many times write(numberBuffer, endIndex, MAX_NUMBER_LENGTH - endIndex); }
@Override public void write(byte[] bytes, int off, int len) { checkArrayOffs(bytes.length, off, len); checkWrite(len); for (int i = 0; i < len; i++) write(bytes[off + i]); }
@Override public void write(byte[] bytes, int off, int len) { checkArrayOffs(bytes.length, off, len); checkWrite(len); for (int i = 0; i < len; i++) write(bytes[off + i]); }
@Override public void readMarshallable(@NotNull Bytes in) throws IllegalStateException { long len = Math.min(remaining(), in.remaining()); long inPosition = in.position(); write(in, inPosition, len); in.position(inPosition + len); }
@Override public void write(@NotNull Byteable byteable) { if (byteable.bytes() == null) { throw new IllegalArgumentException("Attempt to write an unitialized Byteable object"); } write(byteable.bytes(), byteable.offset(), byteable.maxSize()); }
@Override public void write(@NotNull Byteable byteable) { if (byteable.bytes() == null) { throw new IllegalArgumentException("Attempt to write an unitialized Byteable object"); } write(byteable.bytes(), byteable.offset(), byteable.maxSize()); }
@Override public void readMarshallable(@NotNull Bytes in) throws IllegalStateException { long len = Math.min(remaining(), in.remaining()); long inPosition = in.position(); write(in, inPosition, len); in.position(inPosition + len); }
@Override public void write(RandomDataInput bytes) { long toWrite = bytes.remaining(); write(bytes, bytes.position(), toWrite); bytes.skip(toWrite); }
@Override public void write(RandomDataInput bytes) { long toWrite = bytes.remaining(); write(bytes, bytes.position(), toWrite); bytes.skip(toWrite); }
@Override public void write(RandomDataInput bytes, long position, long length) { if (length > remaining()) throw new IllegalArgumentException("Attempt to write " + length + " bytes with " + remaining() + " remaining"); if (bytes instanceof NativeBytes) { UNSAFE.copyMemory(((NativeBytes) bytes).startAddr + position, positionAddr, length); skip(length); } else { super.write(bytes, position, length); } }
@Override public void write(RandomDataInput bytes, long position, long length) { if (length > remaining()) throw new IllegalArgumentException("Attempt to write " + length + " bytes with " + remaining() + " remaining"); if (bytes instanceof NativeBytes) { UNSAFE.copyMemory(((NativeBytes) bytes).startAddr + position, positionAddr, length); skip(length); } else { super.write(bytes, position, length); } }
@Override public void write(RandomDataInput bytes, long position, long length) { if (length > remaining()) throw new IllegalArgumentException("Attempt to write " + length + " bytes with " + remaining() + " remaining"); if (bytes instanceof MappedNativeBytes) { getChronicleUnsafe().copyMemory(((MappedNativeBytes) bytes).start + position, this.position, length); skip(length); } else { super.write(bytes, position, length); } }
@Override public void write(RandomDataInput bytes, long position, long length) { if (length > remaining()) throw new IllegalArgumentException("Attempt to write " + length + " bytes with " + remaining() + " remaining"); if (bytes instanceof MappedNativeBytes) { getChronicleUnsafe().copyMemory(((MappedNativeBytes) bytes).start + position, this.position, length); skip(length); } else { super.write(bytes, position, length); } }