@Override public void write(byte[] b) throws IOException { write(b, 0, b.length); }
@Override public void write(ByteBuffer toWrite) throws IOException { if (toWrite.hasArray()) { write(toWrite.array(), toWrite.arrayOffset() + toWrite.position(), toWrite.remaining()); } else { assert toWrite.isDirect(); MemoryUtil.duplicateDirectByteBuffer(toWrite, hollowBuffer); int toWriteRemaining = toWrite.remaining(); if (toWriteRemaining > buffer.remaining()) { if (strictFlushing) { writeExcessSlow(); } else { doFlush(toWriteRemaining - buffer.remaining()); while (hollowBuffer.remaining() > buffer.capacity()) channel.write(hollowBuffer); } } buffer.put(hollowBuffer); } }
@Override public void write(byte[] b) throws IOException { write(b, 0, b.length); }
@Override public void write(ByteBuffer toWrite) throws IOException { if (toWrite.hasArray()) { write(toWrite.array(), toWrite.arrayOffset() + toWrite.position(), toWrite.remaining()); } else { assert toWrite.isDirect(); MemoryUtil.duplicateDirectByteBuffer(toWrite, hollowBuffer); int toWriteRemaining = toWrite.remaining(); if (toWriteRemaining > buffer.remaining()) { if (strictFlushing) { writeExcessSlow(); } else { doFlush(toWriteRemaining - buffer.remaining()); while (hollowBuffer.remaining() > buffer.capacity()) channel.write(hollowBuffer); } } buffer.put(hollowBuffer); } }
@Override public void writeByte(int v) throws IOException { write(v); }
@Override public void write(ByteBuffer toWrite) throws IOException { if (toWrite.hasArray()) { write(toWrite.array(), toWrite.arrayOffset() + toWrite.position(), toWrite.remaining()); } else { assert toWrite.isDirect(); MemoryUtil.duplicateDirectByteBuffer(toWrite, hollowBuffer); int toWriteRemaining = toWrite.remaining(); if (toWriteRemaining > buffer.remaining()) { if (strictFlushing) { writeExcessSlow(); } else { doFlush(toWriteRemaining - buffer.remaining()); while (hollowBuffer.remaining() > buffer.capacity()) channel.write(hollowBuffer); } } buffer.put(hollowBuffer); } }
@Override public void write(byte[] b) throws IOException { write(b, 0, b.length); }
@Override public void write(ByteBuffer toWrite) throws IOException { if (toWrite.hasArray()) { write(toWrite.array(), toWrite.arrayOffset() + toWrite.position(), toWrite.remaining()); } else { assert toWrite.isDirect(); MemoryUtil.duplicateDirectByteBuffer(toWrite, hollowBuffer); int toWriteRemaining = toWrite.remaining(); if (toWriteRemaining > buffer.remaining()) { if (strictFlushing) { writeExcessSlow(); } else { doFlush(toWriteRemaining - buffer.remaining()); while (hollowBuffer.remaining() > buffer.capacity()) channel.write(hollowBuffer); } } buffer.put(hollowBuffer); } }
@Override public void writeByte(int v) throws IOException { write(v); }
@Override public void write(byte[] b) throws IOException { write(b, 0, b.length); }
@Override public void writeByte(int v) throws IOException { write(v); }
@Override public void writeByte(int v) throws IOException { write(v); }
@Override public void write(Memory memory, long offset, long length) throws IOException { for (ByteBuffer buffer : memory.asByteBuffers(offset, length)) write(buffer); }
@Override public void write(Memory memory, long offset, long length) throws IOException { for (ByteBuffer buffer : memory.asByteBuffers(offset, length)) write(buffer); }
@Override public void write(Memory memory, long offset, long length) throws IOException { for (ByteBuffer buffer : memory.asByteBuffers(offset, length)) write(buffer); }
@Override public void write(Memory memory, long offset, long length) throws IOException { for (ByteBuffer buffer : memory.asByteBuffers(offset, length)) write(buffer); }