aboutsummaryrefslogtreecommitdiff
path: root/ber/bool.go
diff options
context:
space:
mode:
Diffstat (limited to 'ber/bool.go')
-rw-r--r--ber/bool.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/ber/bool.go b/ber/bool.go
index 39d2562..484ecb5 100644
--- a/ber/bool.go
+++ b/ber/bool.go
@@ -1,12 +1,16 @@
package ber
-func UnmarshalBool(b byte) bool {
+import "io"
+
+func UnmarshalBool(r io.ByteReader) bool {
+ b, _ := r.ReadByte()
return b != 0x00
}
-func MarshalBool(b bool) byte {
+func MarshalBool(w io.ByteWriter, b bool) {
if b {
- return 0xFF
+ w.WriteByte(0xFF)
+ } else {
+ w.WriteByte(0)
}
- return 0x00
}