Examples of nioBuffers()


Examples of io.netty.buffer.ByteBuf.nioBuffers()

                    // Get a ByteBuffer view on the ByteBuf
                    ByteBuffer buffer = byteBuf.nioBuffer(byteBuf.writerIndex(), byteBuf.writableBytes());
                    javaChannel().read(
                            buffer, config.getReadTimeout(), TimeUnit.MILLISECONDS, this, READ_HANDLER);
                } else {
                    ByteBuffer[] buffers = byteBuf.nioBuffers(byteBuf.writerIndex(), byteBuf.writableBytes());
                    if (buffers.length == 1) {
                        javaChannel().read(
                                buffers[0], config.getReadTimeout(), TimeUnit.MILLISECONDS, this, READ_HANDLER);
                    } else {
                        javaChannel().read(
View Full Code Here

Examples of io.netty.buffer.ByteBuf.nioBuffers()

        final long writtenBytes;
        if (byteBuf.nioBufferCount() == 1) {
            writtenBytes = javaChannel().write(byteBuf.nioBuffer());
        } else {
            writtenBytes = javaChannel().write(byteBuf.nioBuffers());
        }

        final SelectionKey key = selectionKey();
        final int interestOps = key.interestOps();
View Full Code Here

Examples of io.netty.buffer.ByteBuf.nioBuffers()

        final long writtenBytes;
        if (byteBuf.nioBufferCount() == 1) {
            writtenBytes = javaChannel().write(byteBuf.nioBuffer());
        } else {
            writtenBytes = javaChannel().write(byteBuf.nioBuffers());
        }

        // did not write the message
        if (writtenBytes <= 0 && messageSize > 0) {
            return false;
View Full Code Here

Examples of io.netty.buffer.ByteBuf.nioBuffers()

    Objects.requireNonNull(handler, "handler");
    Arguments.require(position >= 0, "position must be >= 0");
    check();
    ByteBuf buf = buffer.getByteBuf();
    if (buf.nioBufferCount() > 1) {
      Iterator<ByteBuffer> buffers = Arrays.asList(buf.nioBuffers()).iterator();
      doWrite(buffers, position, handler);
    } else {
      ByteBuffer bb = buf.nioBuffer();
      doWrite(bb, position, bb.limit(),  handler);
    }
View Full Code Here

Examples of io.netty.buffer.ByteBuf.nioBuffers()

      }
    };

    ByteBuf buf = buffer.getByteBuf();
    if (buf.nioBufferCount() > 1) {
      Iterator<ByteBuffer> buffers = Arrays.asList(buf.nioBuffers()).iterator();
      doWrite(buffers, writePos, handler);
    } else {
      ByteBuffer bb = buf.nioBuffer();
      doWrite(bb, writePos, bb.limit(), handler);
    }
View Full Code Here

Examples of io.netty.buffer.ByteBuf.nioBuffers()

                    } else {
                        ByteBuffer[] nioBufs = entry.bufs;
                        if (nioBufs == null) {
                            // cached ByteBuffers as they may be expensive to create in terms
                            // of Object allocation
                            entry.bufs = nioBufs = buf.nioBuffers();
                        }
                        nioBufferCount = fillBufferArray(nioBufs, nioBuffers, nioBufferCount);
                    }
                }
            }
View Full Code Here

Examples of io.netty.buffer.ByteBuf.nioBuffers()

      case 1:
        buffers.add(s.nioBuffer(index - adjustment, localLength));
        break;
      default:
        Collections.addAll(buffers,
            s.nioBuffers(index - adjustment, localLength));
      }

      index += localLength;
      length -= localLength;
      i++;
View Full Code Here

Examples of io.netty.buffer.ByteBuf.nioBuffers()

                    } else {
                        ByteBuffer[] nioBufs = entry.bufs;
                        if (nioBufs == null) {
                            // cached ByteBuffers as they may be expensive to create in terms
                            // of Object allocation
                            entry.bufs = nioBufs = buf.nioBuffers();
                        }
                        nioBufferCount = fillBufferArray(nioBufs, nioBuffers, nioBufferCount);
                    }
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.