List of utility methods to do ByteBuffer Write
void | writeBooleanArray(boolean[] array, ByteBuffer out) write Boolean Array if (array == null) { writeVInt(-1, out); return; writeVInt(array.length, out); byte b_true = (byte) 1; byte b_false = (byte) 0; for (int i = 0; i < array.length; i++) { ... |
void | writeBuffer(ByteBuffer dest, ByteBuffer src) write Buffer int position = src.position();
dest.put(src);
src.position(position);
|
int | writeBuffer(ByteChannel channel, ByteBuffer buffer) writing to channel buffer int numberWritten = 0; int totalWritten = numberWritten; while (numberWritten >= 0 && buffer.hasRemaining()) { numberWritten = channel.write(buffer); totalWritten += numberWritten; return totalWritten; |
void | writeBuffer(FileChannel fc, ByteBuffer buf, int startPos) write Buffer int pos = startPos; while (buf.hasRemaining()) { pos += fc.write(buf, pos); |
void | writeBuffer(WritableByteChannel chan, ByteBuffer buf) Write a buffer completely to the channel. while (buf.hasRemaining()) {
chan.write(buf);
|
void | writeByte(ByteBuffer dest, int off, int i) write Byte dest.put(off, (byte) i);
|
void | writeByteArray(byte[] array, ByteBuffer out) write Byte Array if (array == null) { writeVInt(-1, out); return; writeVInt(array.length, out); out.put(array); |
void | writeByteArray(byte[] data, ByteBuffer buffer) write Byte Array buffer.put(data); |
void | writeByteArray(ByteBuffer byteBuffer, byte[] bytes) write Byte Array byteBuffer.put(bytes); |
void | writeByteArray(ByteBuffer logBuf, byte[] b) Write a byte array into the log. writeInt(logBuf, b.length); logBuf.put(b); |