@Override public void write (char[] s,int offset, int length) throws IOException { if (length==0) _out.closeIfAllContentWritten(); while (length > 0) { _bytes.reset(); int chars = length>MAX_OUTPUT_CHARS?MAX_OUTPUT_CHARS:length; _converter.write(s, offset, chars); _converter.flush(); _bytes.writeTo(_out); length-=chars; offset+=chars; } } }
@Override public void write (char[] s,int offset, int length) throws IOException { if (length==0) _out.closeIfAllContentWritten(); while (length > 0) { _bytes.reset(); int chars = length>MAX_OUTPUT_CHARS?MAX_OUTPUT_CHARS:length; _converter.write(s, offset, chars); _converter.flush(); _bytes.writeTo(_out); length-=chars; offset+=chars; } } }
@Override public void write(int b) throws IOException { if (isClosed()) throw new EOFException("Closed"); if (_aggregate == null) _aggregate = _channel.getByteBufferPool().acquire(getBufferSize(), OUTPUT_BUFFER_DIRECT); BufferUtil.append(_aggregate, (byte)b); _written++; // Check if all written or full if (!closeIfAllContentWritten() && BufferUtil.isFull(_aggregate)) _channel.write(_aggregate, false); }
@Override public void write(int b) throws IOException { if (isClosed()) throw new EOFException("Closed"); if (_aggregate == null) _aggregate = _channel.getByteBufferPool().acquire(getBufferSize(), OUTPUT_BUFFER_DIRECT); BufferUtil.append(_aggregate, (byte)b); _written++; // Check if all written or full if (!closeIfAllContentWritten() && BufferUtil.isFull(_aggregate)) _channel.write(_aggregate, false); }
if (!closeIfAllContentWritten() && BufferUtil.isFull(_aggregate)) _channel.write(_aggregate, false);
if (!closeIfAllContentWritten() && BufferUtil.isFull(_aggregate)) _channel.write(_aggregate, false);