docs: def _unpack_const_item(unpacker):
      """
      unpack a constant pool item, which will consist of a type byte
      (see the CONST_ values in this module) and a value of the
      appropriate type
      """
  
      (typecode,) = unpacker.unpack_struct(_B)
  
      if typecode == CONST_Utf8:
          (slen,) = unpacker.unpack_struct(_H)
          val = unpacker.read(slen)
          try:
              val = val.decode("utf8")
          except UnicodeDecodeError:
              # easiest hack to handle java's modified utf-8 encoding
              val = val.replace(b"\xC0\x80", b"\x00").decode("utf8")
  
      elif typecode == CONST_Integer:
          (val,) = unpacker.unpack(">i")
  
      elif typecode == CONST_Float:
          (val,) = unpacker.unpack(">f")
  
      elif typecode == CONST_Long:
          (val,) = unpacker.unpack(">q")
  
      elif typecode == CONST_Double:
          (val,) = unpacker.unpack(">d")
  
      elif typecode in (CONST_Class, CONST_String, CONST_MethodType):
          (val,) = unpacker.unpack_struct(_H)
  
      elif typecode in (CONST_Fieldref, CONST_Methodref,
                        CONST_InterfaceMethodref, CONST_NameAndType,
                        CONST_ModuleId, CONST_InvokeDynamic):
          val = unpacker.unpack_struct(_HH)
  
      elif typecode == CONST_MethodHandle:
          val = unpacker.unpack_struct(_BH)
  
      elif typecode == CONST_MethodType:
          val = unpacker.unpack_struct(_H)
  
      elif typecode == CONST_InvokeDynamic:
          val = unpacker.unpack_struct(_HH)
  
      else:
          raise Unimplemented("unknown constant type %r" % typecode)
  
      return typecode, val