diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-10-17 01:12:02 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-10-17 01:12:02 +0300 |
| commit | ea2384b37ed84567906beb3c877ea419e35b86dc (patch) | |
| tree | 7d6698225087893a14abd0aeb277fbdd79a3015b /bitreader.go | |
| parent | update for github username change (diff) | |
| parent | Merge pull request #3 from BiSaXa/dev (diff) | |
| download | bitreader-ea2384b37ed84567906beb3c877ea419e35b86dc.tar.gz bitreader-ea2384b37ed84567906beb3c877ea419e35b86dc.tar.bz2 bitreader-ea2384b37ed84567906beb3c877ea419e35b86dc.zip | |
Merge branch 'main' of https://github.com/BiSaXa/BitReader
Diffstat (limited to 'bitreader.go')
| -rw-r--r-- | bitreader.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bitreader.go b/bitreader.go index 3fbc221..a56aab8 100644 --- a/bitreader.go +++ b/bitreader.go | |||
| @@ -15,11 +15,16 @@ import ( | |||
| 15 | 15 | ||
| 16 | // ReaderType is the main structure of our Reader. | 16 | // ReaderType is the main structure of our Reader. |
| 17 | // Whenever index == 0, we need to read a new byte from stream into curByte | 17 | // Whenever index == 0, we need to read a new byte from stream into curByte |
| 18 | // | ||
| 19 | // stream io.Reader The underlying stream we're reading bytes from | ||
| 20 | // index uint18 The current index into the byte [0-7] | ||
| 21 | // curByte byte The byte we're currently reading from | ||
| 22 | // le bool Whether to read in little-endian order | ||
| 18 | type ReaderType struct { | 23 | type ReaderType struct { |
| 19 | stream io.Reader // The underlying stream we're reading bytes from | 24 | stream io.Reader |
| 20 | index uint8 // The current index into the byte [0-7] | 25 | index uint8 |
| 21 | curByte byte // The byte we're currently reading from | 26 | curByte byte |
| 22 | le bool // Whether to read in little-endian order | 27 | le bool |
| 23 | } | 28 | } |
| 24 | 29 | ||
| 25 | // Reader is the main constructor that creates the ReaderType object | 30 | // Reader is the main constructor that creates the ReaderType object |