public class StringPool extends ResChunk
The header is followed by an u32[string_count] array of strings offsets (relative to strings_start) where the strings reside. This is then followed by a similar array for styles.
In a utf-8 encoded string pool, a string data consists of: utf-16 length, utf-8 length, string bytes, \0.
In a utf-16 encoded string pool, a string data consists of: utf-16 length, string bytes, \0\0.
A style is an array of tuples (u32 stringref, u32 start, u32 end). A stringref of 0xFFFFFFFF indicates the end of a style array (note that the next array may start at the immediately following word).
ResChunk.RefTransformer, ResChunk.RefVisitor
CHUNK_RES_TABLE_PACKAGE, CHUNK_RES_TABLE_TYPE, CHUNK_RES_TABLE_TYPE_SPEC, CHUNK_RESOURCE_TABLE, CHUNK_STRING_POOL, CHUNK_XML_REF_MAP, CHUNK_XML_TREE
Modifier and Type | Method and Description |
---|---|
StringPool |
copy() |
static StringPool |
create(Iterable<String> strings) |
void |
dump(PrintStream out) |
static StringPool |
get(ByteBuffer buf) |
String |
getOutputNormalizedString(int data) |
String |
getString(int id) |
int |
getStringCount() |
boolean |
isUtf8() |
void |
put(ByteBuffer output) |
getChunkSize, getHeaderSize, getTotalSize, getType, serialize, slice, slice, wrap
public static StringPool create(Iterable<String> strings)
public static StringPool get(ByteBuffer buf)
public void put(ByteBuffer output)
public String getString(int id)
public void dump(PrintStream out)
public int getStringCount()
public boolean isUtf8()
public String getOutputNormalizedString(int data)
public StringPool copy()