public abstract class ResChunk extends Object
Some common types used by different chunks:
StringRef is a u32 string id ResRef is a u32 resource id ResValue is a chunk of: u16 size u8 0x00 u8 dataType (one of ResChunk.RES_XXXXXXX) u32 data
See https://android.googlesource.com/platform/frameworks/base/+/kitkat-release/include/androidfw/ResourceTypes.h for full specification.
Modifier and Type | Class and Description |
---|---|
static interface |
ResChunk.RefTransformer |
static interface |
ResChunk.RefVisitor |
Modifier and Type | Field and Description |
---|---|
static short |
CHUNK_RES_TABLE_PACKAGE |
static short |
CHUNK_RES_TABLE_TYPE |
static short |
CHUNK_RES_TABLE_TYPE_SPEC |
static short |
CHUNK_RESOURCE_TABLE |
static short |
CHUNK_STRING_POOL |
static short |
CHUNK_XML_REF_MAP |
static short |
CHUNK_XML_TREE |
Modifier and Type | Method and Description |
---|---|
int |
getChunkSize() |
int |
getHeaderSize() |
int |
getTotalSize()
For most chunk's totalSize == chunkSize.
|
int |
getType() |
abstract void |
put(ByteBuffer output) |
byte[] |
serialize() |
static ByteBuffer |
slice(ByteBuffer map,
int offset) |
static ByteBuffer |
slice(ByteBuffer map,
int offset,
int length) |
static ByteBuffer |
wrap(byte[] data) |
public static final short CHUNK_STRING_POOL
public static final short CHUNK_RESOURCE_TABLE
public static final short CHUNK_XML_TREE
public static final short CHUNK_XML_REF_MAP
public static final short CHUNK_RES_TABLE_PACKAGE
public static final short CHUNK_RES_TABLE_TYPE
public static final short CHUNK_RES_TABLE_TYPE_SPEC
public final int getType()
public final int getHeaderSize()
public final int getChunkSize()
public int getTotalSize()
public final byte[] serialize()
public abstract void put(ByteBuffer output)
public static ByteBuffer wrap(byte[] data)
public static ByteBuffer slice(ByteBuffer map, int offset)
public static ByteBuffer slice(ByteBuffer map, int offset, int length)