/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
/** * <p> * Writes the contents of the specified {@link Buffer} to the client. * </p> * * Note, that passed {@link Buffer} will be directly used by underlying * connection, so it could be reused only if it has been flushed. * * @param buffer the {@link Buffer} to write * @throws IOException if an error occurs during the write */ public void writeBuffer(final Buffer buffer) throws IOException { connection.assertOpen(); updateNonBlockingStatus(); finishCurrentBuffer(); checkCompositeBuffer(); compositeBuffer.append(buffer); if (canWritePayloadChunk() && compositeBuffer.remaining() > bufferSize) { flush(); } }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }
public void writeByte(final int b) throws IOException { connection.assertOpen(); if (closed) { return; } updateNonBlockingStatus(); if (writingChars()) { flushCharsToBuf(false); } checkCurrentBuffer(); if (!currentBuffer.hasRemaining()) { if (canWritePayloadChunk()) { doCommit(); flushBinaryBuffers(false); checkCurrentBuffer(); blockAfterWriteIfNeeded(); } else { finishCurrentBuffer(); checkCurrentBuffer(); } } currentBuffer.put((byte) b); }