|
@@ -290,6 +290,14 @@ func (rd *realDecoder) peek(offset, length int) (packetDecoder, error) {
|
|
|
return &realDecoder{raw: rd.raw[off : off+length]}, nil
|
|
|
}
|
|
|
|
|
|
+func (rd *realDecoder) peekInt8(offset int) (int8, error) {
|
|
|
+ const byteLen = 1
|
|
|
+ if rd.remaining() < offset+byteLen {
|
|
|
+ return -1, ErrInsufficientData
|
|
|
+ }
|
|
|
+ return int8(rd.raw[rd.off+offset]), nil
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
func (rd *realDecoder) push(in pushDecoder) error {
|