本文整理了Java中okio.Buffer.readInt()
方法的一些代码示例,展示了Buffer.readInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.readInt()
方法的具体详情如下:
包路径:okio.Buffer
类名称:Buffer
方法名:readInt
暂无
代码示例来源:origin: square/okhttp
final long ttl = buf.readInt() & 0xffffffffL; // ttl
final int length = buf.readShort() & 0xffff;
代码示例来源:origin: huxq17/tractor
@Override public int readInt() throws IOException {
require(4);
return buffer.readInt();
}
代码示例来源:origin: huxq17/tractor
@Override public int readIntLe() {
return Util.reverseBytesInt(readInt());
}
代码示例来源:origin: huxq17/tractor
@Override public long readLong() {
if (size < 8) throw new IllegalStateException("size < 8: " + size);
Segment segment = head;
int pos = segment.pos;
int limit = segment.limit;
// If the long is split across multiple segments, delegate to readInt().
if (limit - pos < 8) {
return (readInt() & 0xffffffffL) << 32
| (readInt() & 0xffffffffL);
}
byte[] data = segment.data;
long v = (data[pos++] & 0xffL) << 56
| (data[pos++] & 0xffL) << 48
| (data[pos++] & 0xffL) << 40
| (data[pos++] & 0xffL) << 32
| (data[pos++] & 0xffL) << 24
| (data[pos++] & 0xffL) << 16
| (data[pos++] & 0xffL) << 8
| (data[pos++] & 0xffL);
size -= 8;
if (pos == limit) {
head = segment.pop();
SegmentPool.recycle(segment);
} else {
segment.pos = pos;
}
return v;
}
代码示例来源:origin: com.squareup.okhttp3/okhttp-dnsoverhttps
final long ttl = buf.readInt() & 0xffffffffL; // ttl
final int length = buf.readShort() & 0xffff;
内容来源于网络,如有侵权,请联系作者删除!