Class TypeSpecChunk
- java.lang.Object
-
- com.google.devrel.gmscore.tools.apk.arsc.Chunk
-
- com.google.devrel.gmscore.tools.apk.arsc.TypeSpecChunk
-
- All Implemented Interfaces:
SerializableResource
public final class TypeSpecChunk extends Chunk
A chunk that contains a collection of resource entries for a particular resource data type.
-
-
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 protectedTypeSpecChunk(java.nio.ByteBuffer buffer, Chunk parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetId()Returns the (1-based) type id of the resources that thisTypeSpecChunkhas configuration masks for.intgetResourceCount()Returns the number of resource entries that this chunk has configuration masks for.protected Chunk.TypegetType()java.lang.StringgetTypeName()Returns the name of the type this chunk represents (e.g.protected voidwriteHeader(java.nio.ByteBuffer output)Writes the remaining header (after the type,headerSize, andchunkSize).protected voidwritePayload(java.io.DataOutput output, java.nio.ByteBuffer header, boolean shrink)Writes the chunk payload.-
Methods inherited from class com.google.devrel.gmscore.tools.apk.arsc.Chunk
getHeaderSize, getOriginalChunkSize, getParent, init, newInstance, newInstance, toByteArray, toByteArray, writeHeader, writePad
-
-
-
-
Constructor Detail
-
TypeSpecChunk
protected TypeSpecChunk(java.nio.ByteBuffer buffer, @Nullable Chunk parent)
-
-
Method Detail
-
getId
public int getId()
Returns the (1-based) type id of the resources that thisTypeSpecChunkhas configuration masks for.
-
getResourceCount
public int getResourceCount()
Returns the number of resource entries that this chunk has configuration masks for.
-
getType
protected Chunk.Type getType()
-
getTypeName
public java.lang.String getTypeName()
Returns the name of the type this chunk represents (e.g. string, attr, id).
-
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.
-
writePayload
protected void writePayload(java.io.DataOutput output, java.nio.ByteBuffer header, boolean shrink) throws java.io.IOExceptionDescription copied from class:ChunkWrites the chunk payload. The payload is data in a chunk which is not in the firstheaderSizebytes of the chunk.- Overrides:
writePayloadin classChunk- Parameters:
output- The stream that the payload will be written to.header- The already-written header. This can be modified to fix payload offsets.shrink- True if this payload should be optimized for size.- Throws:
java.io.IOException- Thrown ifoutputcould not be written to (out of memory).
-
-