code: func (s *Scanner) readPayloadLen() (int, error) {
  	if _, err := io.ReadFull(s.r, s.len[:]); err != nil {
  		if err == io.ErrUnexpectedEOF {
  			return 0, ErrInvalidPktLen
  		}
  
  		return 0, err
  	}
  
  	n, err := hexDecode(s.len)
  	if err != nil {
  		return 0, err
  	}
  
  	switch {
  	case n == 0:
  		return 0, nil
  	case n <= lenSize:
  		return 0, ErrInvalidPktLen
  	case n > OversizePayloadMax+lenSize:
  		return 0, ErrInvalidPktLen
  	default:
  		return n - lenSize, nil
  	}
  }
docs: // Method readPayloadLen returns the payload length by reading the
  // pkt-len and subtracting the pkt-len size.