aboutsummaryrefslogtreecommitdiff
path: root/ber/bool.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-09-25 20:41:38 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-09-25 20:41:38 +0200
commit511cf41a779929b5c81b7429c37dc11bd9544182 (patch)
tree6ab421d4b7ec868c48b40da57e3de542831767dd /ber/bool.go
parent0559b7d4eab07cacf0f005e8e756c1d04470e0c7 (diff)
Rewrite from scratch
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
}