forked from quic-go/quic-go
move readUint64 to new file utils.go
This commit is contained in:
@@ -70,15 +70,3 @@ func ParsePublicHeader(b io.ByteReader) (*PublicHeader, error) {
|
|||||||
|
|
||||||
return header, nil
|
return header, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func readUint64(b io.ByteReader, length uint8) (uint64, error) {
|
|
||||||
var res uint64
|
|
||||||
for i := uint8(0); i < length; i++ {
|
|
||||||
bt, err := b.ReadByte()
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
res = res<<8 + uint64(bt)
|
|
||||||
}
|
|
||||||
return res, nil
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user