private void commitStream() throws IOException { commitStream(-1); }
private void commitStream() throws IOException { commitStream(-1); }
private void flushBuffer(boolean endOfStream) throws IOException { if (!directWrite) { int currentSize; if (endOfStream) { currentSize = buffer == null ? 0 : buffer.size(); } else { currentSize = -1; } commitStream(currentSize); if (buffer != null) { buffer.writeTo(adaptedOutput); } } }
private void flushBuffer(boolean endOfStream) throws IOException { if (!directWrite) { int currentSize; if (endOfStream) { currentSize = buffer == null ? 0 : buffer.size(); } else { currentSize = -1; } commitStream(currentSize); if (buffer != null) { buffer.writeTo(adaptedOutput); } } }
/** * Commit the output stream. * * @throws IOException when underlying stream returned from the callback method throws the io exception. */ public void commit() throws IOException { flushBuffer(true); commitStream(); }
/** * Commit the output stream. * * @throws IOException when underlying stream returned from the callback method throws the io exception. */ public void commit() throws IOException { flushBuffer(true); commitStream(); }
@Override public void write(int b) throws IOException { if (directWrite) { commitStream(); adaptedOutput.write(b); } else { if (buffer.size() + 1 > bufferSize) { flushBuffer(false); adaptedOutput.write(b); } else { buffer.write(b); } } }
@Override public void write(byte b[]) throws IOException { if (directWrite) { commitStream(); adaptedOutput.write(b); } else { if (b.length + buffer.size() > bufferSize) { flushBuffer(false); adaptedOutput.write(b); } else { buffer.write(b); } } }
@Override public void write(byte b[]) throws IOException { if (directWrite) { commitStream(); adaptedOutput.write(b); } else { if (b.length + buffer.size() > bufferSize) { flushBuffer(false); adaptedOutput.write(b); } else { buffer.write(b); } } }
@Override public void write(int b) throws IOException { if (directWrite) { commitStream(); adaptedOutput.write(b); } else { if (buffer.size() + 1 > bufferSize) { flushBuffer(false); adaptedOutput.write(b); } else { buffer.write(b); } } }
@Override public void write(byte b[], int off, int len) throws IOException { if (directWrite) { commitStream(); adaptedOutput.write(b, off, len); } else { if (len + buffer.size() > bufferSize) { flushBuffer(false); adaptedOutput.write(b, off, len); } else { buffer.write(b, off, len); } } }
@Override public void write(byte b[], int off, int len) throws IOException { if (directWrite) { commitStream(); adaptedOutput.write(b, off, len); } else { if (len + buffer.size() > bufferSize) { flushBuffer(false); adaptedOutput.write(b, off, len); } else { buffer.write(b, off, len); } } }
private void commitStream() throws IOException { commitStream(-1); }
/** * Commit the output stream. * * @throws IOException when underlying stream returned from the callback method throws the io exception. */ void commit() throws IOException { flushBuffer(true); commitStream(); }
/** * Commit the output stream. * * @throws IOException when underlying stream returned from the callback method throws the io exception. */ public void commit() throws IOException { flushBuffer(true); commitStream(); }
/** * Commit the output stream. * * @throws IOException when underlying stream returned from the callback method throws the io exception. */ void commit() throws IOException { flushBuffer(true); commitStream(); }
/** * Commit the output stream. * * @throws IOException when underlying stream returned from the callback method throws the io exception. */ public void commit() throws IOException { flushBuffer(true); commitStream(); }
/** * Commit the output stream. * * @throws IOException when underlying stream returned from the callback method throws the io exception. */ void commit() throws IOException { flushBuffer(true); commitStream(); }
@Override public void write(byte b[]) throws IOException { if (directWrite) { commitStream(); adaptedOutput.write(b); } else { if (b.length + buffer.size() > bufferSize) { flushBuffer(false); adaptedOutput.write(b); } else { buffer.write(b); } } }
@Override public void write(int b) throws IOException { if (directWrite) { commitStream(); adaptedOutput.write(b); } else { if (buffer.size() + 1 > bufferSize) { flushBuffer(false); adaptedOutput.write(b); } else { buffer.write(b); } } }