Class BinaryResourceFile

    • Constructor Summary

      Constructors 
      Constructor Description
      BinaryResourceFile​(byte[] buf)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static BinaryResourceFile fromInputStream​(java.io.InputStream is)
      Given an input stream, reads the stream until the end and returns a BinaryResourceFile representing the contents of the stream.
      java.util.List<Chunk> getChunks()
      Returns the chunks in this resource file.
      byte[] toByteArray()
      Converts this resource into an array of bytes representation.
      byte[] toByteArray​(boolean shrink)
      Converts this resource into an array of bytes representation.
      • Methods inherited from class java.lang.Object

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

      • BinaryResourceFile

        public BinaryResourceFile​(byte[] buf)
    • Method Detail

      • fromInputStream

        public static BinaryResourceFile fromInputStream​(java.io.InputStream is)
                                                  throws java.io.IOException
        Given an input stream, reads the stream until the end and returns a BinaryResourceFile representing the contents of the stream.
        Parameters:
        is - The input stream to read from.
        Returns:
        BinaryResourceFile represented by the @{link InputStream}.
        Throws:
        java.io.IOException
      • getChunks

        public java.util.List<Chunk> getChunks()
        Returns the chunks in this resource file.
      • toByteArray

        public byte[] toByteArray()
                           throws java.io.IOException
        Description copied from interface: SerializableResource
        Converts this resource into an array of bytes representation.
        Specified by:
        toByteArray in interface SerializableResource
        Returns:
        An array of bytes representing this resource.
        Throws:
        java.io.IOException
      • toByteArray

        public byte[] toByteArray​(boolean shrink)
                           throws java.io.IOException
        Description copied from interface: SerializableResource
        Converts this resource into an array of bytes representation.
        Specified by:
        toByteArray in interface SerializableResource
        Parameters:
        shrink - True if, when converting to a byte array, this resource can modify the returned bytes in an effort to reduce the size.
        Returns:
        An array of bytes representing this resource.
        Throws:
        java.io.IOException