本文整理了Java中org.vertx.java.core.buffer.Buffer.appendByte()
方法的一些代码示例,展示了Buffer.appendByte()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.appendByte()
方法的具体详情如下:
包路径:org.vertx.java.core.buffer.Buffer
类名称:Buffer
方法名:appendByte
[英]Appends the specified byte to the end of the Buffer. The buffer will expand as necessary to accomodate any bytes written.
Returns a reference to this so multiple operations can be appended together.
[中]将指定的字节追加到缓冲区的末尾。缓冲区将根据需要扩展以容纳写入的任何字节。
返回对此的引用,以便可以将多个操作附加在一起。
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendByte(body ? (byte)1 : (byte)0);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendInt(encoded.length);
buff.appendBytes(encoded);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendShort(body);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendInt(encoded.length);
buff.appendBytes(encoded);
}
encoded = null;
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendLong(body);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendInt(body.length);
buff.appendBytes(body);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendInt(body);
}
}
代码示例来源:origin: org.vert-x/vertx-core
public void fillInRequest(HttpClientRequest req, String hostHeader) throws Exception {
req.headers().put(HttpHeaders.Names.CONNECTION, "Upgrade");
req.headers().put(HttpHeaders.Names.UPGRADE, "WebSocket");
req.headers().put(HttpHeaders.Names.HOST, hostHeader);
req.headers().put(HttpHeaders.Names.SEC_WEBSOCKET_KEY1, this.challenge.getKey1String());
req.headers().put(HttpHeaders.Names.SEC_WEBSOCKET_KEY2, this.challenge.getKey2String());
Buffer buff = new Buffer(6);
buff.appendBytes(challenge.getKey3());
buff.appendByte((byte) '\r');
buff.appendByte((byte) '\n');
req.write(buff);
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendFloat(body);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendDouble(body);
}
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
public static Buffer toBuffer(ByteBuffer buff) {
Buffer self = new Buffer(buff.remaining());
while (buff.hasRemaining()) {
self.appendByte(buff.get());
}
return self;
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
public static Buffer toBuffer(ByteBuffer buff) {
Buffer self = new Buffer(buff.remaining());
while (buff.hasRemaining()) {
self.appendByte(buff.get());
}
return self;
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
public static Buffer toBuffer(ByteBuffer buff) {
Buffer self = new Buffer(buff.remaining());
while (buff.hasRemaining()) {
self.appendByte(buff.get());
}
return self;
}
代码示例来源:origin: io.fabric8/gateway-core
static public Buffer encode(String value) {
int size = value.length();
Buffer rc = new Buffer(size);
for (int i = 0; i < size; i++) {
rc.appendByte((byte) (value.charAt(i) & 0xFF));
}
return rc;
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
public static Buffer toBuffer(ByteBuffer buff) {
Buffer self = new Buffer(buff.remaining());
while (buff.hasRemaining()) {
self.appendByte(buff.get());
}
return self;
}
代码示例来源:origin: com.englishtown/vertx-mod-jersey
/**
* {@inheritDoc}
*/
@Override
public void write(int b) throws IOException {
checkState();
buffer.appendByte((byte) b);
}
代码示例来源:origin: jboss-fuse/fabric8
public static Buffer toBuffer(ByteBuffer buff) {
Buffer self = new Buffer(buff.remaining());
while( buff.hasRemaining() ) {
self.appendByte(buff.get());
}
return self;
}
代码示例来源:origin: jboss-fuse/fabric8
static public Buffer encode(String value) {
int size = value.length();
Buffer rc = new Buffer(size);
for (int i = 0; i < size; i++) {
rc.appendByte((byte) (value.charAt(i) & 0xFF));
}
return rc;
}
代码示例来源:origin: org.vert-x/vertx-core
protected void writeBody(Buffer buff) {
if (body == null) {
buff.appendByte((byte)0);
} else {
buff.appendByte((byte)1);
buff.appendInt(body.length());
buff.appendBuffer(body);
}
}
代码示例来源:origin: com.englishtown/vertx-mod-jersey
/**
* {@inheritDoc}
*/
@Override
public void write(int b) throws IOException {
checkState();
Buffer buffer = new Buffer();
buffer.appendByte((byte) b);
response.write(buffer);
}
内容来源于网络,如有侵权,请联系作者删除!