/** * {@inheritDoc} */ @Override public void write(char[] cbuf, int off, int len) throws IOException { outputBuffer.write(cbuf, off, len); }
/** * {@inheritDoc} */ @Override public void flush() throws IOException { outputBuffer.flush(); }
/** * {@inheritDoc} * * @deprecated the <code>length</code> parameter will be ignored. Pls use {@link #canWrite()}. */ @Override public boolean canWrite(final int length) { return outputBuffer.canWrite(); }
private boolean flushBinaryBuffers(final boolean isLast) throws IOException { if (!outputHeader.isChunkingAllowed() && outputHeader.getContentLength() == -1) { if (!isLast) { return false; } else { outputHeader.setContentLength(getBufferedDataSize()); } } final Buffer bufferToFlush; final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining(); if (isFlushComposite) { finishCurrentBuffer(); bufferToFlush = compositeBuffer; compositeBuffer = null; } else if (currentBuffer != null && currentBuffer.position() > 0) { currentBuffer.trim(); bufferToFlush = currentBuffer; currentBuffer = null; } else { bufferToFlush = null; } if (bufferToFlush != null || isLast) { doCommit(); flushBuffer(bufferToFlush, isLast, null); return true; } return false; }
/** * {@inheritDoc} */ @Override public void close() throws IOException { outputBuffer.close(); }
/** * {@inheritDoc} */ @Override public void notifyCanWrite(final WriteHandler handler) { outputBuffer.notifyCanWrite(handler); }
/** * {@inheritDoc} */ @Override public void write(final Buffer buffer) throws IOException { outputBuffer.writeBuffer(buffer); }
/** * {@inheritDoc} */ @Override public void write(final int b) throws IOException { outputBuffer.writeByte(b); }
private static void sendZeroCopy(final Response response, final File file) throws IOException { final OutputBuffer outputBuffer = response.getOutputBuffer(); outputBuffer.sendfile(file, null); }
/** * {@inheritDoc} */ @Override public void write(int c) throws IOException { outputBuffer.writeChar(c); }
/** * Are there any pending writes waiting to be flushed? */ public boolean hasData() { return !suspended && (!grizzlyResponse.isCommitted() || grizzlyOutputBuffer.getBufferedDataSize() > 0); } // END PWC 6512276
private boolean flushBinaryBuffers(final boolean isLast) throws IOException { if (!outputHeader.isChunkingAllowed() && outputHeader.getContentLength() == -1) { if (!isLast) { return false; } else { outputHeader.setContentLength(getBufferedDataSize()); } } final Buffer bufferToFlush; final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining(); if (isFlushComposite) { finishCurrentBuffer(); bufferToFlush = compositeBuffer; compositeBuffer = null; } else if (currentBuffer != null && currentBuffer.position() > 0) { currentBuffer.trim(); bufferToFlush = currentBuffer; currentBuffer = null; } else { bufferToFlush = null; } if (bufferToFlush != null || isLast) { doCommit(); flushBuffer(bufferToFlush, isLast, null); return true; } return false; }
/** * {@inheritDoc} */ @Override public void close() throws IOException { outputBuffer.close(); }
/** * {@inheritDoc} * @deprecated the <code>length</code> parameter will be ignored. Pls. use {@link #notifyCanWrite(org.glassfish.grizzly.WriteHandler)}. */ @Override public void notifyCanWrite(final WriteHandler handler, final int length) { outputBuffer.notifyCanWrite(handler); }
/** * {@inheritDoc} */ @Override public void write(final Buffer buffer) throws IOException { outputBuffer.writeBuffer(buffer); }
/** * {@inheritDoc} */ @Override public void write(final int b) throws IOException { outputBuffer.writeByte(b); }
private static void sendZeroCopy(final Response response, final File file) throws IOException { final OutputBuffer outputBuffer = response.getOutputBuffer(); outputBuffer.sendfile(file, null); }
/** * {@inheritDoc} */ @Override public void write(int c) throws IOException { outputBuffer.writeChar(c); }
private boolean flushBinaryBuffers(final boolean isLast) throws IOException { if (!outputHeader.isChunkingAllowed() && outputHeader.getContentLength() == -1) { if (!isLast) { return false; } else { outputHeader.setContentLength(getBufferedDataSize()); } } final Buffer bufferToFlush; final boolean isFlushComposite = compositeBuffer != null && compositeBuffer.hasRemaining(); if (isFlushComposite) { finishCurrentBuffer(); bufferToFlush = compositeBuffer; compositeBuffer = null; } else if (currentBuffer != null && currentBuffer.position() > 0) { currentBuffer.trim(); bufferToFlush = currentBuffer; currentBuffer = null; } else { bufferToFlush = null; } if (bufferToFlush != null || isLast) { doCommit(); flushBuffer(bufferToFlush, isLast, null); return true; } return false; }
/** * {@inheritDoc} */ @Override public void write(String str, int off, int len) throws IOException { outputBuffer.write(str, off, len); }