code: def decode_bytes(f):
      
  
      buf = f.read(FIELD_U16.size)
      if len(buf) < FIELD_U16.size:
          raise UnderflowDecodeError()
  
      (num_bytes,) = FIELD_U16.unpack_from(buf)
      num_bytes_consumed = FIELD_U16.size + num_bytes
  
      buf = f.read(num_bytes)
      if len(buf) < num_bytes:
          raise UnderflowDecodeError()
  
      return num_bytes_consumed, buf
docs: Decode a buffer length from a 2-byte unsigned int then read the
      subsequent bytes.
  
      Parameters
      ----------
      f: file
          File-like object with read method.
  
      Raises
      ------
      UnderflowDecodeError
          When the end of stream is encountered before the end of the
          encoded bytes.
  
      Returns
      -------
      int
          Number of bytes read from `f`.
      bytes
          Value bytes decoded from `f`.