ReadByte implements the io.ByteReader interface.
()
| 81 | |
| 82 | // ReadByte implements the io.ByteReader interface. |
| 83 | func (self *ZeroCopySource) NextByte() (data byte, eof bool) { |
| 84 | if self.off >= uint64(len(self.s)) { |
| 85 | return 0, true |
| 86 | } |
| 87 | |
| 88 | b := self.s[self.off] |
| 89 | self.off++ |
| 90 | return b, false |
| 91 | } |
| 92 | |
| 93 | func (self *ZeroCopySource) NextUint8() (data uint8, eof bool) { |
| 94 | var val byte |
no outgoing calls