Class ImageRawStream.ByteArrayStreamFactory
java.lang.Object
org.apache.xmlgraphics.image.loader.impl.ImageRawStream.ByteArrayStreamFactory
- All Implemented Interfaces:
ImageRawStream.InputStreamFactory
- Enclosing class:
ImageRawStream
public static class ImageRawStream.ByteArrayStreamFactory
extends Object
implements ImageRawStream.InputStreamFactory
InputStream factory that wraps a byte array.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the factory and releases any resources held open during the lifetime of this object.Creates and returns a new InputStream.booleanIndicates whether this factory is only usable once or many times.
-
Field Details
-
data
private byte[] data
-
-
Constructor Details
-
ByteArrayStreamFactory
public ByteArrayStreamFactory(byte[] data) Main constructor.- Parameters:
data- the byte array
-
-
Method Details
-
createInputStream
Creates and returns a new InputStream.- Specified by:
createInputStreamin interfaceImageRawStream.InputStreamFactory- Returns:
- the new InputStream
-
close
public void close()Closes the factory and releases any resources held open during the lifetime of this object.- Specified by:
closein interfaceImageRawStream.InputStreamFactory
-
isUsedOnceOnly
public boolean isUsedOnceOnly()Indicates whether this factory is only usable once or many times.- Specified by:
isUsedOnceOnlyin interfaceImageRawStream.InputStreamFactory- Returns:
- true if the factory can only be used once
-