Lines Matching defs:buffer
74 * Enqueues a write of the buffer to the channel.
75 * The call is asynchronous so the buffer is not safe to modify after
76 * passing the buffer here.
78 * @param buffer the buffer to send to the channel
80 private void writeMessage(final ByteBuffer buffer) {
84 queue.add(buffer);
98 ByteBuffer buffer;
101 buffer = queue.poll();
102 if (buffer == null) {
107 // No new data in buffer to write
109 writeBuffer(buffer);
113 private void writeBuffer(ByteBuffer buffer) {
114 channel.write(buffer, buffer, new CompletionHandler<Integer, ByteBuffer>() {
116 public void completed(Integer result, ByteBuffer buffer) {
117 if (buffer.hasRemaining()) {
118 channel.write(buffer, buffer, this);
199 * @return the next newline separated message in the buffer. null is returned if the buffer