This commit is contained in:
Redkale
2019-11-23 09:28:18 +08:00
parent fee4555cef
commit 004b83172e

View File

@@ -105,6 +105,15 @@ public class ByteBufferReader {
return v;
}
//提前预读一个字节
public byte preget() {
ByteBuffer buf = this.currBuffer;
if (!buf.hasRemaining()) {
buf = this.buffers[this.currIndex + 1];
}
return buf.get(buf.position());
}
public byte get() {
ByteBuffer buf = this.currBuffer;
if (!buf.hasRemaining()) {