本文整理了Java中com.couchbase.client.deps.io.netty.buffer.ByteBuf.setBytes()
方法的一些代码示例,展示了ByteBuf.setBytes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteBuf.setBytes()
方法的具体详情如下:
包路径:com.couchbase.client.deps.io.netty.buffer.ByteBuf
类名称:ByteBuf
方法名:setBytes
[英]Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer becomes unreadable. This method is basically same with #setBytes(int,ByteBuf,int,int), except that this method increases the readerIndex of the source buffer by the number of the transferred bytes while #setBytes(int,ByteBuf,int,int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
[中]从指定的绝对索引开始,将指定源缓冲区的数据传输到此缓冲区,直到源缓冲区变得不可读为止。此方法与#setBytes(int,ByteBuf,int,int)基本相同,只是此方法将源缓冲区的readerIndex增加传输的字节数,而#setBytes(int,ByteBuf,int,int)不增加。此方法不会修改源缓冲区的readerIndex或writerIndex(即此)。
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, byte[] src, int srcIndex, int length) {
buf.setBytes(index, src, srcIndex, length);
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public ByteBuf setBytes(int index, byte[] src) {
buf.setBytes(index, src);
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, ByteBuf src) {
buf.setBytes(index, src);
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length) {
buf.setBytes(index, src, srcIndex, length);
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, byte[] src, int srcIndex, int length) {
buf.setBytes(index, src, srcIndex, length);
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public ByteBuf setBytes(int index, ByteBuf src) {
buf.setBytes(index, src);
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, ByteBuf src, int length) {
buf.setBytes(index, src, length);
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length) {
buf.setBytes(index, src, srcIndex, length);
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public int setBytes(int index, InputStream in, int length)
throws IOException {
return unwrap().setBytes(index, in, length);
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, ByteBuffer src) {
unwrap().setBytes(index, src);
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public int setBytes(int index, ScatteringByteChannel in, int length)
throws IOException {
return unwrap().setBytes(index, in, length);
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public int setBytes(int index, ScatteringByteChannel in, int length)
throws IOException {
return unwrap().setBytes(index, in, length);
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, ByteBuffer src) {
checkIndex0(index, src.remaining());
unwrap().setBytes(idx(index), src);
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public ByteBuf setBytes(int index, ByteBuffer src) {
checkIndex0(index, src.remaining());
unwrap().setBytes(idx(index), src);
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length) {
checkIndex0(index, length);
unwrap().setBytes(idx(index), src, srcIndex, length);
return this;
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public ByteBuf setBytes(int index, byte[] src, int srcIndex, int length) {
checkIndex0(index, length);
unwrap().setBytes(idx(index), src, srcIndex, length);
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public int setBytes(int index, InputStream in, int length) throws IOException {
checkIndex0(index, length);
return unwrap().setBytes(idx(index), in, length);
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public int setBytes(int index, ScatteringByteChannel in, int length) throws IOException {
checkIndex0(index, length);
return unwrap().setBytes(idx(index), in, length);
}
代码示例来源:origin: couchbase/couchbase-jvm-core
@Override
public final ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length) {
checkDstIndex(index, length, dstIndex, dst.capacity());
if (dst.hasMemoryAddress()) {
PlatformDependent.copyMemory(memory, idx(index), dst.memoryAddress() + dstIndex, length);
} else if (dst.hasArray()) {
getBytes(index, dst.array(), dst.arrayOffset() + dstIndex, length);
} else {
dst.setBytes(dstIndex, memory, idx(index), length);
}
return this;
}
代码示例来源:origin: com.couchbase.client/core-io
@Override
public final ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length) {
checkDstIndex(index, length, dstIndex, dst.capacity());
if (dst.hasMemoryAddress()) {
PlatformDependent.copyMemory(memory, idx(index), dst.memoryAddress() + dstIndex, length);
} else if (dst.hasArray()) {
getBytes(index, dst.array(), dst.arrayOffset() + dstIndex, length);
} else {
dst.setBytes(dstIndex, memory, idx(index), length);
}
return this;
}
内容来源于网络,如有侵权,请联系作者删除!