Package proguard.dexfile.reader.util
Class Mutf8
- java.lang.Object
-
- proguard.dexfile.reader.util.Mutf8
-
public final class Mutf8 extends java.lang.Object
Modified UTF-8 as described in the dex file format spec.Derived from libcore's MUTF-8 encoder at java.nio.charset.ModifiedUtf8.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
decode(java.nio.ByteBuffer in, java.lang.StringBuilder sb)
Decodes bytes fromin
intosb
until a delimiter 0x00 is encountered.static void
encode(byte[] dst, int offset, java.lang.String s)
Encodes the modified UTF-8 bytes corresponding tos
intodst
, starting atoffset
.static byte[]
encode(java.lang.String s)
Returns an array containing the modified UTF-8 form ofs
.
-
-
-
Method Detail
-
decode
public static java.lang.String decode(java.nio.ByteBuffer in, java.lang.StringBuilder sb) throws java.io.UTFDataFormatException
Decodes bytes fromin
intosb
until a delimiter 0x00 is encountered. Returns a new string containing the decoded characters.- Throws:
java.io.UTFDataFormatException
-
encode
public static void encode(byte[] dst, int offset, java.lang.String s)
Encodes the modified UTF-8 bytes corresponding tos
intodst
, starting atoffset
.
-
encode
public static byte[] encode(java.lang.String s) throws java.io.UTFDataFormatException
Returns an array containing the modified UTF-8 form ofs
.- Throws:
java.io.UTFDataFormatException
-
-