Class BinaryResourceFile
- java.lang.Object
-
- com.google.devrel.gmscore.tools.apk.arsc.BinaryResourceFile
-
- All Implemented Interfaces:
SerializableResource
public final class BinaryResourceFile extends java.lang.Object implements SerializableResource
Given an arsc file, maps the contents of the file.
-
-
Constructor Summary
Constructors Constructor Description BinaryResourceFile(byte[] buf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BinaryResourceFilefromInputStream(java.io.InputStream is)Given an input stream, reads the stream until the end and returns aBinaryResourceFilerepresenting the contents of the stream.java.util.List<Chunk>getChunks()Returns the chunks in this resource file.byte[]toByteArray()Converts this resource into an array of bytes representation.byte[]toByteArray(boolean shrink)Converts this resource into an array of bytes representation.
-
-
-
Method Detail
-
fromInputStream
public static BinaryResourceFile fromInputStream(java.io.InputStream is) throws java.io.IOException
Given an input stream, reads the stream until the end and returns aBinaryResourceFilerepresenting the contents of the stream.- Parameters:
is- The input stream to read from.- Returns:
- BinaryResourceFile represented by the @{link InputStream}.
- Throws:
java.io.IOException
-
getChunks
public java.util.List<Chunk> getChunks()
Returns the chunks in this resource file.
-
toByteArray
public byte[] toByteArray() throws java.io.IOExceptionDescription copied from interface:SerializableResourceConverts this resource into an array of bytes representation.- Specified by:
toByteArrayin interfaceSerializableResource- Returns:
- An array of bytes representing this resource.
- Throws:
java.io.IOException
-
toByteArray
public byte[] toByteArray(boolean shrink) throws java.io.IOExceptionDescription copied from interface:SerializableResourceConverts this resource into an array of bytes representation.- Specified by:
toByteArrayin interfaceSerializableResource- Parameters:
shrink- True if, when converting to a byte array, this resource can modify the returned bytes in an effort to reduce the size.- Returns:
- An array of bytes representing this resource.
- Throws:
java.io.IOException
-
-