public ByteBuf getBytes(int var1, ByteBuf var2, int var3, int var4) {
    this.checkDstIndex(var1, var4, var3, var2.capacity());
    if (var2.hasArray()) {
      this.getBytes(var1, var2.array(), var2.arrayOffset() + var3, var4);
    } else if (var2.nioBufferCount() > 0) {
      ByteBuffer[] var5 = var2.nioBuffers(var3, var4);
      int var6 = var5.length;

      for (int var7 = 0; var7 < var6; ++var7) {
        ByteBuffer var8 = var5[var7];
        int var9 = var8.remaining();
        this.getBytes(var1, var8);
        var1 += var9;
      }
    } else {
      var2.setBytes(var3, (ByteBuf) this, var1, var4);
    }

    return this;
  }
Example #2
0
 @Override
 public ByteBuf setBytes(int index, ByteBuffer src) {
   return buf.setBytes(index, src);
 }
Example #3
0
 @Override
 public ByteBuf setBytes(int index, byte[] src, int srcIndex, int length) {
   return buf.setBytes(index, src, srcIndex, length);
 }
Example #4
0
 @Override
 public ByteBuf setBytes(int index, byte[] src) {
   return buf.setBytes(index, src);
 }
Example #5
0
 @Override
 public ByteBuf setBytes(int index, ByteBuf src, int length) {
   return buf.setBytes(index, src, length);
 }
Example #6
0
 private Buffer setBytes(int pos, String str, Charset charset) {
   byte[] bytes = str.getBytes(charset);
   ensureWritable(pos, bytes.length);
   buffer.setBytes(pos, bytes);
   return this;
 }
Example #7
0
 /**
  * Sets the bytes at position {@code pos} in the Buffer to the bytes represented by the {@code
  * byte[] b}.
  *
  * <p>The buffer will expand as necessary to accommodate any value written.
  */
 public Buffer setBytes(int pos, byte[] b) {
   ensureWritable(pos, b.length);
   buffer.setBytes(pos, b);
   return this;
 }
 @Override
 public ByteBuf setBytes(int var1, byte[] var2) {
   return a.setBytes(var1, var2);
 }
Example #9
0
 /**
  * Sets the bytes at position {@code pos} in the Buffer to the bytes represented by the {@code
  * Buffer b}.
  *
  * <p>The buffer will expand as necessary to accommodate any value written.
  */
 public Buffer setBuffer(int pos, Buffer b) {
   ensureWritable(pos, b.length());
   buffer.setBytes(pos, b.getByteBuf());
   return this;
 }
 @Override
 public int setBytes(int var1, ScatteringByteChannel var2, int var3) throws IOException {
   return a.setBytes(var1, var2, var3);
 }
 @Override
 public int setBytes(int var1, InputStream var2, int var3) throws IOException {
   return a.setBytes(var1, var2, var3);
 }
 @Override
 public ByteBuf setBytes(int var1, ByteBuffer var2) {
   return a.setBytes(var1, var2);
 }
 @Override
 public ByteBuf setBytes(int var1, byte[] var2, int var3, int var4) {
   return a.setBytes(var1, var2, var3, var4);
 }
Example #14
0
 @Override
 public int setBytes(int index, InputStream in, int length) throws IOException {
   return buf.setBytes(index, in, length);
 }
Example #15
0
 /**
  * Sets the bytes at position {@code pos} in the Buffer to the bytes represented by the {@code
  * ByteBuffer b}.
  *
  * <p>The buffer will expand as necessary to accommodate any value written.
  */
 public Buffer setBytes(int pos, ByteBuffer b) {
   ensureWritable(pos, b.limit());
   buffer.setBytes(pos, b);
   return this;
 }
Example #16
0
 @Override
 public int setBytes(int index, ScatteringByteChannel in, int length) throws IOException {
   return buf.setBytes(index, in, length);
 }
 @Override
 public ByteBuf setBytes(int var1, ByteBuf var2, int var3) {
   return a.setBytes(var1, var2, var3);
 }