Class EncodeUtils
- java.lang.Object
-
- com.android.tools.build.apkzlib.zip.EncodeUtils
-
public class EncodeUtils extends java.lang.ObjectUtilities to encode and decode file names in zips.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancanAsciiEncode(java.lang.String text)Checks if some text may be encoded using ASCII.static java.lang.Stringdecode(byte[] data, com.android.tools.build.apkzlib.zip.GPFlags flags)Decodes a file name.static java.lang.Stringdecode(java.nio.ByteBuffer bytes, int length, com.android.tools.build.apkzlib.zip.GPFlags flags)Decodes a file name.static byte[]encode(java.lang.String name, com.android.tools.build.apkzlib.zip.GPFlags flags)Encodes a file name.
-
-
-
Method Detail
-
decode
public static java.lang.String decode(java.nio.ByteBuffer bytes, int length, com.android.tools.build.apkzlib.zip.GPFlags flags) throws java.io.IOExceptionDecodes a file name.- Parameters:
bytes- the raw data buffer to read fromlength- the number of bytes in the raw data buffer containing the string to decodeflags- the zip entry flags- Returns:
- the decode file name
- Throws:
java.io.IOException
-
decode
public static java.lang.String decode(byte[] data, com.android.tools.build.apkzlib.zip.GPFlags flags)Decodes a file name.- Parameters:
data- the raw dataflags- the zip entry flags- Returns:
- the decode file name
-
encode
public static byte[] encode(java.lang.String name, com.android.tools.build.apkzlib.zip.GPFlags flags)Encodes a file name.- Parameters:
name- the name to encodeflags- the zip entry flags- Returns:
- the encoded file name
-
canAsciiEncode
public static boolean canAsciiEncode(java.lang.String text)
Checks if some text may be encoded using ASCII.- Parameters:
text- the text to check- Returns:
- can it be encoded using ASCII?
-
-