本文整理了Java中org.vertx.java.core.buffer.Buffer.getByte()
方法的一些代码示例,展示了Buffer.getByte()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.getByte()
方法的具体详情如下:
包路径:org.vertx.java.core.buffer.Buffer
类名称:Buffer
方法名:getByte
[英]Returns the byte at position pos in the Buffer.
[中]返回缓冲区中位置pos处的字节。
代码示例来源:origin: org.vert-x/vertx-core
protected void readBody(int pos, Buffer readBuff) {
boolean isNull = readBuff.getByte(pos) == (byte)0;
if (!isNull) {
body = readBuff.getByte(++pos);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void readBody(int pos, Buffer readBuff) {
boolean isNull = readBuff.getByte(pos) == (byte)0;
if (!isNull) {
pos++;
int strLength = readBuff.getInt(pos);
pos += 4;
byte[] bytes = readBuff.getBytes(pos, pos + strLength);
body = new String(bytes, CharsetUtil.UTF_8);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void readBody(int pos, Buffer readBuff) {
boolean isNull = readBuff.getByte(pos) == (byte)0;
if (!isNull) {
body = new Boolean(readBuff.getByte(pos + 1) == (byte)1);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void readBody(int pos, Buffer readBuff) {
boolean isNull = readBuff.getByte(pos) == (byte)0;
if (!isNull) {
pos++;
int strLength = readBuff.getInt(pos);
pos += 4;
byte[] bytes = readBuff.getBytes(pos, pos + strLength);
String str = new String(bytes, CharsetUtil.UTF_8);
body = new JsonArray(str);
}
}
代码示例来源:origin: jboss-fuse/fabric8
static public boolean matches(Buffer self, int pos, Buffer needle) {
int needleLength = needle.length();
for (int i = 0; i < needleLength; i++) {
if( self.getByte(pos+i) != needle.getByte(i) ) {
return false;
}
}
return true;
}
代码示例来源:origin: io.fabric8/gateway-core
static public boolean matches(Buffer self, int pos, Buffer needle) {
int needleLength = needle.length();
for (int i = 0; i < needleLength; i++) {
if( self.getByte(pos+i) != needle.getByte(i) ) {
return false;
}
}
return true;
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
static public boolean matches(Buffer self, int pos, Buffer needle) {
int needleLength = needle.length();
for (int i = 0; i < needleLength; i++) {
if (self.getByte(pos + i) != needle.getByte(i)) {
return false;
}
}
return true;
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
static public boolean matches(Buffer self, int pos, Buffer needle) {
int needleLength = needle.length();
for (int i = 0; i < needleLength; i++) {
if (self.getByte(pos + i) != needle.getByte(i)) {
return false;
}
}
return true;
}
代码示例来源:origin: io.fabric8/gateway-core
static public int indexOf(Buffer self, int start, int end, byte value) {
int max = Math.min(end, self.length());
for (; start < end ; start++) {
if (self.getByte(start) == value ) {
return start;
}
}
return -1;
}
代码示例来源:origin: org.vert-x/vertx-core
protected void readBody(int pos, Buffer readBuff) {
boolean isNull = readBuff.getByte(pos) == (byte)0;
if (!isNull) {
body = readBuff.getInt(++pos);
}
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
static public int indexOf(Buffer self, int start, int end, byte value) {
int max = Math.min(end, self.length());
for (; start < end; start++) {
if (self.getByte(start) == value) {
return start;
}
}
return -1;
}
代码示例来源:origin: org.vert-x/vertx-core
protected void readBody(int pos, Buffer readBuff) {
boolean isNull = readBuff.getByte(pos) == (byte)0;
if (!isNull) {
body = readBuff.getFloat(++pos);
}
}
代码示例来源:origin: org.vert-x/vertx-core
protected void readBody(int pos, Buffer readBuff) {
boolean isNull = readBuff.getByte(pos) == (byte)0;
if (!isNull) {
body = readBuff.getDouble(++pos);
}
}
代码示例来源:origin: io.fabric8/gateway-core
static public String decode(Buffer value) {
int size = value.length();
char rc[] = new char[size];
for (int i = 0; i < size; i++) {
rc[i] = (char) (value.getByte(i) & 0xFF);
}
return new String(rc);
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
static public int indexOf(Buffer self, int start, int end, byte value) {
int max = Math.min(end, self.length());
for (; start < end; start++) {
if (self.getByte(start) == value) {
return start;
}
}
return -1;
}
代码示例来源:origin: io.fabric8/gateway-core
static public Buffer trimEnd(Buffer self) {
int length = self.length();
int pos = length;
while ( pos > 0 && (self.getByte(pos-1) <= ' ')) {
pos--;
}
return (pos == length-1) ? self : self.getBuffer(0, pos);
}
代码示例来源:origin: io.fabric8.ipaas.apps/fabric8mq
static public Buffer trimEnd(Buffer self) {
int length = self.length();
int pos = length;
while (pos > 0 && (self.getByte(pos - 1) <= ' ')) {
pos--;
}
return (pos == length - 1) ? self : self.getBuffer(0, pos);
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
static public Buffer trimFront(Buffer self) {
int length = self.length();
int pos = 0;
while ((pos < length) && (self.getByte(pos) <= ' ')) {
pos++;
}
return (pos == 0) ? self : self.getBuffer(pos, length);
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
static public Buffer trimEnd(Buffer self) {
int length = self.length();
int pos = length;
while (pos > 0 && (self.getByte(pos - 1) <= ' ')) {
pos--;
}
return (pos == length - 1) ? self : self.getBuffer(0, pos);
}
代码示例来源:origin: io.fabric8.jube.images.fabric8/fabric8-mq
static public Buffer trimEnd(Buffer self) {
int length = self.length();
int pos = length;
while (pos > 0 && (self.getByte(pos - 1) <= ' ')) {
pos--;
}
return (pos == length - 1) ? self : self.getBuffer(0, pos);
}
内容来源于网络,如有侵权,请联系作者删除!