diff options
author | anon5 <anon5clam@protonmail.com> | 2021-06-21 18:47:26 +0000 |
---|---|---|
committer | anon5 <anon5clam@protonmail.com> | 2021-06-21 18:47:26 +0000 |
commit | 425da65ed46061303604610bb539d6495b2b1f3f (patch) | |
tree | 10ae3e665132c369ce0207676321cef870679923 /bytereader.go | |
parent | 9f239d341ef46b656dda759020da87bdd0606344 (diff) | |
download | mt-425da65ed46061303604610bb539d6495b2b1f3f.tar.xz |
Add high-level protocol (de)serialization
Diffstat (limited to 'bytereader.go')
-rw-r--r-- | bytereader.go | 13 |
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 +} |