@Override default void writeShort(R handle, long offset, short i) { handle.writeShort(offset, i); }
@Override default void writeShort(R handle, long offset, short i) { handle.writeShort(offset, i); }
@NotNull default R writeInt24(long offset, int i) throws BufferOverflowException { writeShort(offset, (short) i); return writeByte(offset + 2, (byte) (i >> 16)); }
/** * Write an unsigned byte at an offset. * * @param offset to write to * @param i the value * @return this * @throws BufferOverflowException if the capacity was exceeded * @throws IllegalArgumentException if the value cannot be cast to the type without loss. */ @NotNull default R writeUnsignedShort(long offset, int i) throws BufferOverflowException, IllegalArgumentException { return writeShort(offset, (short) Maths.toUInt16(i)); }