public class ImageRawStream extends AbstractImage
Modifier and Type | Class and Description |
---|---|
static class |
ImageRawStream.ByteArrayStreamFactory
InputStream factory that wraps a byte array.
|
static interface |
ImageRawStream.InputStreamFactory
Represents a factory for InputStream objects.
|
Constructor and Description |
---|
ImageRawStream(ImageInfo info,
ImageFlavor flavor,
ImageRawStream.InputStreamFactory streamFactory)
Main constructor.
|
ImageRawStream(ImageInfo info,
ImageFlavor flavor,
java.io.InputStream in)
Constructor for a simple InputStream as parameter.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
createInputStream()
Returns a new InputStream to access the raw image.
|
ImageFlavor |
getFlavor()
Returns the flavor of the image.
|
java.lang.String |
getMimeType()
Returns the MIME type of the stream data.
|
boolean |
isCacheable()
Indicates whether the Image instance is cacheable in memory.
|
void |
setInputStreamFactory(ImageRawStream.InputStreamFactory factory)
Sets the InputStreamFactory to be used by this image.
|
void |
writeTo(java.io.File target)
Writes the content of the image to a File.
|
void |
writeTo(java.io.OutputStream out)
Writes the content of the image to an OutputStream.
|
getColorSpace, getICCProfile, getInfo, getSize, toString
public ImageRawStream(ImageInfo info, ImageFlavor flavor, ImageRawStream.InputStreamFactory streamFactory)
info
- the image info objectflavor
- the image flavor for the raw imagestreamFactory
- the InputStreamFactory that is used to create InputStream instancespublic ImageRawStream(ImageInfo info, ImageFlavor flavor, java.io.InputStream in)
info
- the image info objectflavor
- the image flavor for the raw imagein
- the InputStream with the raw contentpublic ImageFlavor getFlavor()
public java.lang.String getMimeType()
public boolean isCacheable()
public void setInputStreamFactory(ImageRawStream.InputStreamFactory factory)
factory
- the new InputStreamFactorypublic java.io.InputStream createInputStream()
public void writeTo(java.io.OutputStream out) throws java.io.IOException
out
- the OutputStreamjava.io.IOException
- if an I/O error occurspublic void writeTo(java.io.File target) throws java.io.IOException
target
- the file to be writtenjava.io.IOException
- if an I/O error occursCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.