docs: def read(self, fmt):
          """Interpret next bits according to the format string and return result.
  
          fmt -- Token string describing how to interpret the next bits.
  
          Token examples: 'int:12'    : 12 bits as a signed integer
                          'uint:8'    : 8 bits as an unsigned integer
                          'float:64'  : 8 bytes as a big-endian float
                          'intbe:16'  : 2 bytes as a big-endian signed integer
                          'uintbe:16' : 2 bytes as a big-endian unsigned integer
                          'intle:32'  : 4 bytes as a little-endian signed integer
                          'uintle:32' : 4 bytes as a little-endian unsigned integer
                          'floatle:64': 8 bytes as a little-endian float
                          'intne:24'  : 3 bytes as a native-endian signed integer
                          'uintne:24' : 3 bytes as a native-endian unsigned integer
                          'floatne:32': 4 bytes as a native-endian float
                          'hex:80'    : 80 bits as a hex string
                          'oct:9'     : 9 bits as an octal string
                          'bin:1'     : single bit binary string
                          'ue'        : next bits as unsigned exp-Golomb code
                          'se'        : next bits as signed exp-Golomb code
                          'uie'       : next bits as unsigned interleaved exp-Golomb code
                          'sie'       : next bits as signed interleaved exp-Golomb code
                          'bits:5'    : 5 bits as a bitstring
                          'bytes:10'  : 10 bytes as a bytes object
                          'bool'      : 1 bit as a bool
                          'pad:3'     : 3 bits of padding to ignore - returns None
  
          fmt may also be an integer, which will be treated like the 'bits' token.
  
          The position in the bitstring is advanced to after the read items.
  
          Raises ReadError if not enough bits are available.
          Raises ValueError if the format is not understood.
  
          """
          if isinstance(fmt, numbers.Integral):
              if fmt < 0:
                  raise ValueError("Cannot read negative amount.")
              if fmt > self.len - self._pos:
                  raise ReadError("Cannot read {0} bits, only {1} available.",
                                  fmt, self.len - self._pos)
              bs = self._slice(self._pos, self._pos + fmt)
              self._pos += fmt
              return bs
          p = self._pos
          _, token = tokenparser(fmt)
          if len(token) != 1:
              self._pos = p
              raise ValueError("Format string should be a single token, not {0} "
                               "tokens - use readlist() instead.".format(len(token)))
          name, length, _ = token[0]
          if length is None:
              length = self.len - self._pos
          value, self._pos = self._readtoken(name, self._pos, length)
          return value