Class ResourceTableChunk

  • All Implemented Interfaces:
    SerializableResource

    public final class ResourceTableChunk
    extends ChunkWithChunks
    Represents a resource table structure. Its sub-chunks contain:
    • A StringPoolChunk containing all string values in the entire resource table. It does not, however, contain the names of entries or type identifiers.
    • One or more PackageChunk.
    • 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: Chunk
        Finishes 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:
        init in class ChunkWithChunks
        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 given packageName. Else, returns null.
      • getPackages

        public java.util.Collection<PackageChunk> getPackages()
        Returns the packages contained in this resource table.
      • writeHeader

        protected void writeHeader​(java.nio.ByteBuffer output)
        Description copied from class: Chunk
        Writes the remaining header (after the type, headerSize, and chunkSize).
        Overrides:
        writeHeader in class Chunk
        Parameters:
        output - The buffer that the header will be written to.