mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 12:51:22 +00:00
.
This commit is contained in:
@ -117,6 +117,13 @@ func ReadUInt8(r io.Reader) UInt8 {
|
||||
return UInt8(buf[0])
|
||||
}
|
||||
|
||||
func ReadUInt8Safe(r io.Reader) (UInt8, error) {
|
||||
buf := [1]byte{0}
|
||||
_, err := io.ReadFull(r, buf[:])
|
||||
if err != nil { return UInt8(0), err }
|
||||
return UInt8(buf[0]), nil
|
||||
}
|
||||
|
||||
|
||||
// Int16
|
||||
|
||||
|
Reference in New Issue
Block a user