@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.byteOrder() == byteOrder()) { while (length >= 8) { writeLong(bytes.readLong(position)); position += 8; length -= 8; } } while (length >= 1) { writeByte(bytes.readByte(position)); 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.byteOrder() == byteOrder()) { while (length >= 8) { writeLong(bytes.readLong(position)); position += 8; length -= 8; } } while (length >= 1) { writeByte(bytes.readByte(position)); position++; length--; } }