コード例 #1
0
ファイル: Buffer.java プロジェクト: hugozhu/vert.x
 /**
  * Appends the specified {@code Buffer} to the end of the Buffer. The buffer will expand as
  * necessary to accomodate any bytes written.
  *
  * <p>Returns a reference to {@code this} so multiple operations can be appended together.
  */
 public Buffer appendBuffer(Buffer buff) {
   ChannelBuffer cb = buff.getChannelBuffer();
   buffer.writeBytes(buff.getChannelBuffer());
   cb.readerIndex(
       0); // Need to reset readerindex since Netty write modifies readerIndex of source!
   return this;
 }
コード例 #2
0
 /**
  * Write a {@link Buffer} to the request body. The {@code doneHandler} is called after the buffer
  * is actually written to the wire.
  *
  * <p>
  *
  * @return A reference to this, so multiple method calls can be chained.
  */
 public HttpClientRequest write(Buffer chunk, Handler<Void> doneHandler) {
   check();
   return write(chunk.getChannelBuffer(), doneHandler);
 }
コード例 #3
0
 /**
  * Write a {@link Buffer} to the request body.
  *
  * <p>
  *
  * @return A reference to this, so multiple method calls can be chained.
  */
 public HttpClientRequest write(Buffer chunk) {
   check();
   return write(chunk.getChannelBuffer(), null);
 }
コード例 #4
0
 /** Write a {@link Buffer} to the request body. */
 public void writeBuffer(Buffer chunk) {
   check();
   write(chunk.getChannelBuffer(), null);
 }
コード例 #5
0
ファイル: DefaultAsyncFile.java プロジェクト: pkdevbox/vert.x
 public void write(Buffer buffer, int position, AsyncResultHandler<Void> handler) {
   check();
   ByteBuffer bb = buffer.getChannelBuffer().toByteBuffer();
   doWrite(bb, position, handler);
 }
コード例 #6
0
ファイル: Buffer.java プロジェクト: hugozhu/vert.x
 /**
  * Sets the bytes at position {@code pos} in the Buffer to the value {@code b}.
  *
  * <p>The buffer will expand as necessary to accomodate any value written.
  */
 public Buffer setBuffer(int pos, Buffer b) {
   ensureWritable(pos, b.length());
   buffer.setBytes(pos, b.getChannelBuffer());
   return this;
 }