kotlin 클래스의 상수 풀에 있는 미친 UTF-8 항목 (Crazy UTF-8 entry in a kotlin class' constant pool)


문제 설명

kotlin 클래스의 상수 풀에 있는 미친 UTF‑8 항목 (Crazy UTF‑8 entry in a kotlin class' constant pool)

Kotlin 소스에서 .class 파일의 내용을 검사할 때(그냥 "Hello World", 다른 것은 없음) 상수 풀 내에서 (a) 어디에도 사용되지 않고 (b) 다음과 같은 UTF‑8 문자열을 찾았습니다. 이상한 콘텐츠입니다.

이것이 무엇인지 말해 줄 수 있습니까?

여기에 이미지 설명 입력


참조 솔루션

방법 1:

This is the content of kotlin.Metadata annotation. It is coded with Protobuf and used by both compiler and Kotlin‑Reflect.

Kotlin uses String instead of byte[] because class format is very wasteful at storing arrays.

When you are not using Kotlin‑Reflect, metadata is unused and can be removed by ProGuard.

(by ChristianMiha_x64)

참조 문서

  1. Crazy UTF‑8 entry in a kotlin class' constant pool (CC BY‑SA 2.5/3.0/4.0)

#class-constants #class #Kotlin #java






관련 질문

NDK: 자바 클래스에서 .c 상수를 사용하는 방법 (NDK: How to use .c constants in java class)

상수 클래스 멤버, 할당 연산자 및 QList (Constant class members, assignment operator and QList)

kotlin 클래스의 상수 풀에 있는 미친 UTF-8 항목 (Crazy UTF-8 entry in a kotlin class' constant pool)

PHP 5.3 ~ PHP7 - 정의되지 않은 클래스 상수 'self::MYCONST' (PHP 5.3 to PHP7 - Undefined class constant 'self::MYCONST')

PHP의 특정 클래스에 정의된 '클래스 상수'와 함께 defined() 메서드를 사용하는 방법은 무엇입니까? (How to use defined() method with 'Class Constants' that are defined into a specific class in PHP?)

클래스 상수를 사용한 PHP 객체 액세스 (PHP Object access with class constant)

Java에서 상수 클래스를 어떻게 정의합니까? (How do you define a class of constants in Java?)







코멘트