Class 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.
    • 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 this TypeSpecChunk has configuration masks for.
      • getResourceCount

        public int getResourceCount()
        Returns the number of resource entries that this chunk has configuration masks for.
      • 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: 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.
      • writePayload

        protected void writePayload​(java.io.DataOutput output,
                                    java.nio.ByteBuffer header,
                                    boolean shrink)
                             throws java.io.IOException
        Description copied from class: Chunk
        Writes the chunk payload. The payload is data in a chunk which is not in the first headerSize bytes of the chunk.
        Overrides:
        writePayload in class Chunk
        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 if output could not be written to (out of memory).