public final class BinaryResourceFile extends java.lang.Object implements SerializableResource
| Constructor and Description |
|---|
BinaryResourceFile(byte[] buf) |
| Modifier and Type | Method and 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.
|
public static BinaryResourceFile fromInputStream(java.io.InputStream is) throws java.io.IOException
BinaryResourceFile
representing the contents of the stream.is - The input stream to read from.java.io.IOExceptionpublic java.util.List<Chunk> getChunks()
public byte[] toByteArray()
throws java.io.IOException
SerializableResourcetoByteArray in interface SerializableResourcejava.io.IOExceptionpublic byte[] toByteArray(boolean shrink)
throws java.io.IOException
SerializableResourcetoByteArray in interface SerializableResourceshrink - True if, when converting to a byte array, this resource can modify the returned
bytes in an effort to reduce the size.java.io.IOException