Class AbstractResource

  • All Implemented Interfaces:
    Resource, java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    PreprocessResource

    public abstract class AbstractResource
    extends java.lang.Object
    implements Resource
    • Constructor Detail

      • AbstractResource

        protected AbstractResource​(long modified)
    • Method Detail

      • getExtra

        public java.lang.String getExtra()
        Description copied from interface: Resource
        Use Resource.decodeExtra(String) to properly decode the ZIP extra field structured binary data from the returned String.
        Specified by:
        getExtra in interface Resource
        Returns:
        A String encoding the ZIP extra field.
      • openInputStream

        public java.io.InputStream openInputStream()
                                            throws java.lang.Exception
        Specified by:
        openInputStream in interface Resource
        Throws:
        java.lang.Exception
      • buffer

        public java.nio.ByteBuffer buffer()
                                   throws java.lang.Exception
        Specified by:
        buffer in interface Resource
        Throws:
        java.lang.Exception
      • setExtra

        public void setExtra​(java.lang.String extra)
        Description copied from interface: Resource
        Use Resource.encodeExtra(byte[]) to properly encode the ZIP extra field structured binary data into the specified String.
        Specified by:
        setExtra in interface Resource
        Parameters:
        extra - A String encoding the ZIP extra field.
      • write

        public void write​(java.io.OutputStream out)
                   throws java.lang.Exception
        Specified by:
        write in interface Resource
        Throws:
        java.lang.Exception
      • getBytes

        protected abstract byte[] getBytes()
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • size

        public long size()
                  throws java.lang.Exception
        Specified by:
        size in interface Resource
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException