aboutsummaryrefslogtreecommitdiff
path: root/ber/bool.go
blob: 484ecb5b2a3794c3498add43b3c4f7c84bc5b023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package ber

import "io"

func UnmarshalBool(r io.ByteReader) bool {
	b, _ := r.ReadByte()
	return b != 0x00
}

func MarshalBool(w io.ByteWriter, b bool) {
	if b {
		w.WriteByte(0xFF)
	} else {
		w.WriteByte(0)
	}
}