summaryrefslogtreecommitdiff
path: root/bytereader.go
diff options
context:
space:
mode:
authoranon5 <anon5clam@protonmail.com>2021-06-21 18:47:26 +0000
committeranon5 <anon5clam@protonmail.com>2021-06-21 18:47:26 +0000
commit425da65ed46061303604610bb539d6495b2b1f3f (patch)
tree10ae3e665132c369ce0207676321cef870679923 /bytereader.go
parent9f239d341ef46b656dda759020da87bdd0606344 (diff)
downloadmt-425da65ed46061303604610bb539d6495b2b1f3f.tar.xz
Add high-level protocol (de)serialization
Diffstat (limited to 'bytereader.go')
-rw-r--r--bytereader.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/bytereader.go b/bytereader.go
new file mode 100644
index 0000000..77447d0
--- /dev/null
+++ b/bytereader.go
@@ -0,0 +1,13 @@
+package mt
+
+import "io"
+
+type byteReader struct {
+ io.Reader
+}
+
+func (br byteReader) ReadByte() (byte, error) {
+ buf := make([]byte, 1)
+ _, err := io.ReadFull(br, buf)
+ return buf[0], err
+}