本文整理了Java中org.vertx.java.core.buffer.Buffer.copy()
方法的一些代码示例,展示了Buffer.copy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.copy()
方法的具体详情如下:
包路径:org.vertx.java.core.buffer.Buffer
类名称:Buffer
方法名:copy
[英]Returns a copy of the entire Buffer.
[中]返回整个缓冲区的副本。
代码示例来源:origin: org.vert-x/vertx-core
static <T> T copyIfRequired(T obj) {
if (obj instanceof byte[]) {
//Copy it
byte[] bytes = (byte[]) obj;
byte[] copy = new byte[bytes.length];
System.arraycopy(bytes, 0, copy, 0, bytes.length);
return (T) copy;
} else if (obj instanceof Buffer) {
//Copy it
return (T) ((Buffer) obj).copy();
} else {
return obj;
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected Message copy() {
BufferMessage copied = new BufferMessage(send, address, body == null ? null : body.copy());
copied.replyAddress = this.replyAddress;
copied.bus = this.bus;
copied.sender = this.sender;
return copied;
}
代码示例来源:origin: io.fabric8/gateway-core
public void setBuffer(Buffer value) {
if( !startsWith(value, PREFIX) || value.length()!=8 ) {
throw new IllegalArgumentException("Not an AMQP header buffer");
}
buffer = value.copy();
}
代码示例来源:origin: jboss-fuse/fabric8
public void setBuffer(Buffer value) {
if( !startsWith(value, PREFIX) || value.length()!=8 ) {
throw new IllegalArgumentException("Not an AMQP header buffer");
}
buffer = value.copy();
}
代码示例来源:origin: vert-x/mod-lang-php
/**
* Copies the buffer.
*/
public Value copy(Env env) {
return env.wrapJava(new Buffer(buffer.copy()));
}
代码示例来源:origin: jboss-fuse/fabric8
received.appendBuffer(event);
if (LOG.isTraceEnabled()) {
LOG.trace("Socket received following data: {}", event.copy().toString().replaceAll("\r", " "));
LOG.trace("Data handled by Handler {}", this.toString());
内容来源于网络,如有侵权,请联系作者删除!