mirror of
https://github.com/documize/community.git
synced 2025-07-19 05:09:42 +02:00
Sync with Community
This commit is contained in:
parent
df8f650319
commit
989b7cd62c
123 changed files with 5054 additions and 2015 deletions
24
vendor/github.com/go-asn1-ber/asn1-ber/util.go
generated
vendored
Normal file
24
vendor/github.com/go-asn1-ber/asn1-ber/util.go
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
package ber
|
||||
|
||||
import "io"
|
||||
|
||||
func readByte(reader io.Reader) (byte, error) {
|
||||
bytes := make([]byte, 1)
|
||||
_, err := io.ReadFull(reader, bytes)
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
return 0, io.ErrUnexpectedEOF
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
return bytes[0], nil
|
||||
}
|
||||
|
||||
func isEOCPacket(p *Packet) bool {
|
||||
return p != nil &&
|
||||
p.Tag == TagEOC &&
|
||||
p.ClassType == ClassUniversal &&
|
||||
p.TagType == TypePrimitive &&
|
||||
len(p.ByteValue) == 0 &&
|
||||
len(p.Children) == 0
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue