@Override default void writeUnsignedByte(R handle, long offset, int i) { handle.writeUnsignedByte(offset, i); }
@Override default void writeUnsignedByte(R handle, long offset, int i) { handle.writeUnsignedByte(offset, i); }
public static void append8bit(long offsetInRDO, RandomDataOutput bytes, @NotNull CharSequence str, int offset, int length) throws IllegalArgumentException, BufferOverflowException, BufferUnderflowException, IndexOutOfBoundsException { if (bytes instanceof VanillaBytes) { @org.jetbrains.annotations.NotNull VanillaBytes vb = (VanillaBytes) bytes; if (str instanceof RandomDataInput) { vb.write(offsetInRDO, (RandomDataInput) str, offset, length); return; } if (str instanceof String) { vb.write(offsetInRDO, str, offset, length); return; } } for (int i = 0; i < length; i++) { char c = str.charAt(offset + i); if (c > 255) c = '?'; bytes.writeUnsignedByte(offsetInRDO + i, c); } }
if (numDigitsRequired > width) throw new IllegalArgumentException("Value do not fit in " + width + " digits"); out.writeUnsignedByte(offset++, '0'); out.writeUnsignedByte(offset++, '.'); while (decimalPlaces-- > digits) out.writeUnsignedByte(offset++, '0'); out.write(offset++, numberBuffer, endIndex, digits); return; out.writeUnsignedByte(offset++, '0'); out.write(offset, numberBuffer, endIndex, decimalLength); offset += decimalLength; out.writeUnsignedByte(offset++, '.'); out.write(offset++, numberBuffer, endIndex + decimalLength, digits - decimalLength);