Class ResourceTableChunk
- java.lang.Object
-
- com.google.devrel.gmscore.tools.apk.arsc.Chunk
-
- com.google.devrel.gmscore.tools.apk.arsc.ChunkWithChunks
-
- com.google.devrel.gmscore.tools.apk.arsc.ResourceTableChunk
-
- All Implemented Interfaces:
SerializableResource
public final class ResourceTableChunk extends ChunkWithChunks
Represents a resource table structure. Its sub-chunks contain:- A
StringPoolChunkcontaining all string values in the entire resource table. It does not, however, contain the names of entries or type identifiers. - One or more
PackageChunk.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.devrel.gmscore.tools.apk.arsc.Chunk
Chunk.Type
-
-
Field Summary
-
Fields inherited from class com.google.devrel.gmscore.tools.apk.arsc.Chunk
chunkSize, headerSize, METADATA_SIZE, offset, PAD_BOUNDARY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResourceTableChunk(java.nio.ByteBuffer buffer, Chunk parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PackageChunkgetPackage(java.lang.String packageName)Returns the package with the givenpackageName.java.util.Collection<PackageChunk>getPackages()Returns the packages contained in this resource table.StringPoolChunkgetStringPool()Returns the string pool containing all string resource values in the resource table.protected Chunk.TypegetType()protected voidinit(java.nio.ByteBuffer buffer)Finishes initialization of a chunk.protected voidwriteHeader(java.nio.ByteBuffer output)Writes the remaining header (after the type,headerSize, andchunkSize).-
Methods inherited from class com.google.devrel.gmscore.tools.apk.arsc.ChunkWithChunks
getChunks, writePayload
-
Methods inherited from class com.google.devrel.gmscore.tools.apk.arsc.Chunk
getHeaderSize, getOriginalChunkSize, getParent, newInstance, newInstance, toByteArray, toByteArray, writeHeader, writePad
-
-
-
-
Constructor Detail
-
ResourceTableChunk
protected ResourceTableChunk(java.nio.ByteBuffer buffer, @Nullable Chunk parent)
-
-
Method Detail
-
init
protected void init(java.nio.ByteBuffer buffer)
Description copied from class:ChunkFinishes initialization of a chunk. This should be called immediately after the constructor. This is separate from the constructor so that the header of a chunk can be fully initialized before the payload of that chunk is initialized for chunks that require such behavior.- Overrides:
initin classChunkWithChunks- Parameters:
buffer- The buffer that the payload will be initialized from.
-
getStringPool
public StringPoolChunk getStringPool()
Returns the string pool containing all string resource values in the resource table.
-
getPackage
@Nullable public PackageChunk getPackage(java.lang.String packageName)
Returns the package with the givenpackageName. Else, returns null.
-
getPackages
public java.util.Collection<PackageChunk> getPackages()
Returns the packages contained in this resource table.
-
getType
protected Chunk.Type getType()
-
writeHeader
protected void writeHeader(java.nio.ByteBuffer output)
Description copied from class:ChunkWrites the remaining header (after the type,headerSize, andchunkSize).- Overrides:
writeHeaderin classChunk- Parameters:
output- The buffer that the header will be written to.
-
-