Class ItemDeserializer


  • public class ItemDeserializer
    extends java.lang.Object
    ItemDeserializer facilitates the reading of a compressed data stream contained within a "packed" file. A "packed" file contains the following meta-data which is available after construction:
    • Item name
    • Content type (int)
    • File type (int)
    • Data length
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Close packed-file input stream and free resources.
      protected void finalize()  
      java.lang.String getContentType()
      Returns packed content type
      int getFileType()
      Returns packed file type.
      java.lang.String getItemName()
      Returns packed item name
      long getLength()
      Returns unpacked data length
      void saveItem​(java.io.OutputStream out, TaskMonitor monitor)
      Save the item to the specified output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ItemDeserializer

        public ItemDeserializer​(java.io.File packedFile)
                         throws java.io.IOException
        Constructor.
        Parameters:
        in - input stream. The input stream must not be read again until after the saveItem method has been invoked successfully.
        Throws:
        java.io.IOException
      • ItemDeserializer

        public ItemDeserializer​(ResourceFile packedFile)
                         throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • dispose

        public void dispose()
        Close packed-file input stream and free resources.
      • getItemName

        public java.lang.String getItemName()
        Returns packed item name
      • getContentType

        public java.lang.String getContentType()
        Returns packed content type
      • getFileType

        public int getFileType()
        Returns packed file type.
      • getLength

        public long getLength()
        Returns unpacked data length
      • saveItem

        public void saveItem​(java.io.OutputStream out,
                             TaskMonitor monitor)
                      throws IOCancelledException,
                             java.io.IOException
        Save the item to the specified output stream. This method may only be invoked once.
        Parameters:
        out -
        monitor -
        Throws:
        java.io.IOException
        IOCancelledException