本文整理了Java中org.vertx.java.core.buffer.Buffer.appendBuffer()
方法的一些代码示例,展示了Buffer.appendBuffer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.appendBuffer()
方法的具体详情如下:
包路径:org.vertx.java.core.buffer.Buffer
类名称:Buffer
方法名:appendBuffer
[英]Appends the specified Buffer to the end of this 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: io.fabric8/gateway-core
@Override
public void handle(Buffer buffer) {
if( encryptedReadBuffer == null ) {
encryptedReadBuffer = buffer;
} else {
encryptedReadBuffer.appendBuffer(buffer);
}
encryptedReadBufferUnderflow = false;
pumpReads();
}
});
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
@Override
public void handle(Buffer buffer) {
if (encryptedReadBuffer == null) {
encryptedReadBuffer = buffer;
} else {
encryptedReadBuffer.appendBuffer(buffer);
}
encryptedReadBufferUnderflow = false;
pumpReads();
}
});
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
@Override
public void handle(Buffer buffer) {
if (encryptedReadBuffer == null) {
encryptedReadBuffer = buffer;
} else {
encryptedReadBuffer.appendBuffer(buffer);
}
encryptedReadBufferUnderflow = false;
pumpReads();
}
});
代码示例来源:origin: jboss-fuse/fabric8
@Override
public void handle(Buffer buffer) {
if( encryptedReadBuffer == null ) {
encryptedReadBuffer = buffer;
} else {
encryptedReadBuffer.appendBuffer(buffer);
}
encryptedReadBufferUnderflow = false;
pumpReads();
}
});
代码示例来源:origin: org.vert-x/vertx-core
public void handle(Buffer buff) {
body.appendBuffer(buff);
}
});
代码示例来源:origin: io.vertx/mod-rxvertx
public Buffer call(Buffer b1, Buffer b2) {
b1.appendBuffer(b2);
return b1;
}
};
代码示例来源:origin: io.fabric8/gateway-core
@Override
public SslSocketWrapper write(Buffer buffer) {
if( plainWriteBuffer==null ) {
plainWriteBuffer = buffer;
} else {
plainWriteBuffer.appendBuffer(buffer);
}
pumpWrites();
return this;
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
@Override
public SslSocketWrapper write(Buffer buffer) {
if (plainWriteBuffer == null) {
plainWriteBuffer = buffer;
} else {
plainWriteBuffer.appendBuffer(buffer);
}
pumpWrites();
return this;
}
代码示例来源:origin: com.englishtown/vertx-mod-jersey
public void handle(Buffer buff) {
body.appendBuffer(buff);
if (body.length() > maxBodySize) {
throw new RuntimeException("The input stream has exceeded the max allowed body size "
+ maxBodySize + ".");
}
}
});
代码示例来源:origin: jboss-fuse/fabric8
@Override
public SslSocketWrapper write(Buffer buffer) {
if( plainWriteBuffer==null ) {
plainWriteBuffer = buffer;
} else {
plainWriteBuffer.appendBuffer(buffer);
}
pumpWrites();
return this;
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
@Override
public SslSocketWrapper write(Buffer buffer) {
if (plainWriteBuffer == null) {
plainWriteBuffer = buffer;
} else {
plainWriteBuffer.appendBuffer(buffer);
}
pumpWrites();
return this;
}
代码示例来源:origin: org.vert-x/vertx-core
/**
* This method is called to provide the parser with data.
* @param buffer
*/
public void handle(Buffer buffer) {
if (buff == null) {
buff = buffer;
} else {
buff.appendBuffer(buffer);
}
handleParsing();
}
}
代码示例来源:origin: vert-x/mod-lang-php
public Buffer appendBuffer(Env env, Value value) {
buffer.appendBuffer(((Buffer) value.toJavaObject(env, Buffer.class)).__toVertxBuffer());
return this;
}
代码示例来源:origin: jboss-fuse/fabric8
public static Ascii encodeHeader(String value) {
if (value == null)
return null;
try {
byte[] data = value.getBytes("UTF-8");
Buffer rc = new Buffer(data.length);
for (byte d : data) {
switch (d) {
case ESCAPE_BYTE:
rc.appendBuffer(ESCAPE_ESCAPE_SEQ.toBuffer());
break;
case COLON_BYTE:
rc.appendBuffer(COLON_ESCAPE_SEQ.toBuffer());
break;
case NEWLINE_BYTE:
rc.appendBuffer(COLON_ESCAPE_SEQ.toBuffer());
break;
default:
rc.appendByte(d);
}
}
return ascii(rc);
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e); // not expected.
}
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
@Override
public void handle(Buffer event) {
if (error == null) {
if (buff == null) {
buff = event;
} else {
buff.appendBuffer(event);
}
try {
T rc = read();
while (rc != null) {
codecHander.handle(rc);
rc = read();
}
} catch (Exception e) {
LOG.debug("Protocol decoding failure: " + e, e);
error = e.getMessage();
errorHandler.handle(error);
}
}
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
@Override
public void handle(Buffer event) {
if (error == null) {
if (buff == null) {
buff = event;
} else {
buff.appendBuffer(event);
}
try {
T rc = read();
while (rc != null) {
codecHander.handle(rc);
rc = read();
}
} catch (Exception e) {
LOG.debug("Protocol decoding failure: " + e, e);
error = e.getMessage();
errorHandler.handle(error);
}
}
}
代码示例来源:origin: io.fabric8/gateway-core
@Override
public void handle(Buffer event) {
if( error==null ) {
if( buff == null ) {
buff = event;
} else {
buff.appendBuffer(event);
}
try {
T rc = read();
while( rc !=null ) {
codecHander.handle(rc);
rc = read();
}
} catch (Exception e) {
LOG.debug("Protocol decoding failure: "+e, e);
error = e.getMessage();
errorHandler.handle(error);
}
}
}
代码示例来源:origin: jboss-fuse/fabric8
@Override
public void handle(Buffer event) {
if( error==null ) {
if( buff == null ) {
buff = event;
} else {
buff.appendBuffer(event);
}
try {
T rc = read();
while( rc !=null ) {
codecHander.handle(rc);
rc = read();
}
} catch (Exception e) {
LOG.debug("Protocol decoding failure: "+e, e);
error = e.getMessage();
errorHandler.handle(error);
}
}
}
代码示例来源: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: vert-x/mod-lang-php
/**
* Appends the given value to the buffer.
*/
public Buffer append(Env env, Value value) {
if (value.isLong()) {
buffer.appendLong(value.toLong());
}
else if (value.isDouble()) {
buffer.appendDouble(value.toDouble());
}
else if (value.isNumeric()) {
buffer.appendInt(value.toInt());
}
else if (value.isString()) {
buffer.appendString(value.toString());
}
else if (value.isObject()) {
buffer.appendBuffer((org.vertx.java.core.buffer.Buffer) value.toJavaObject(env, org.vertx.java.core.buffer.Buffer.class));
}
return this;
}
内容来源于网络,如有侵权,请联系作者删除!