public class ImageInputStreamAdapter extends ImageInputStreamImpl implements AccessibleStream<InputStream>
ImageInputStream that gets its input from
a regular InputStream. No buffering is performed in this
adapter hence it is suitable whenever the underlying is is able to perform
marking itself, like it happens for a BufferedInputStream.
In general, it is preferable to use a FileCacheImageInputStream
or MemoryCacheImageInputStream when reading from a regular
InputStream, but this class can help with improving
perfomances in some cases.
bitOffset, byteOrder, flushedPos, streamPos| Constructor and Description |
|---|
ImageInputStreamAdapter(InputStream stream)
Constructs a n
ImageInputStreamAdapter that will read from
a given InputStream. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this
ImageInputStreamAdapter. |
Class<InputStream> |
getBinding()
Retrieve the class for the target object.
|
static ImageInputStream |
getStream(InputStream stream) |
InputStream |
getTarget()
Retrieves the target object on which we work.
|
boolean |
isCached()
Returns
true since this ImageInputStream
does not cache data in order to allow seeking backwards but it relies on
the underlying InputStream. |
boolean |
isCachedFile()
Returns
false since this ImageInputStream
does not maintain a eraf cache. |
boolean |
isCachedMemory()
Returns
false since this ImageInputStream
does not maintain a main memory cache. |
void |
mark() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
reset() |
checkClosed, finalize, flush, flushBefore, getBitOffset, getByteOrder, getFlushedPosition, getStreamPosition, length, read, readBit, readBits, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, seek, setBitOffset, setByteOrder, skipBytes, skipBytespublic ImageInputStreamAdapter(InputStream stream)
ImageInputStreamAdapter that will read from
a given InputStream.is - an InputStream to read from.IllegalArgumentException - if is is null.public int read()
throws IOException
read in interface ImageInputStreamread in class ImageInputStreamImplIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in interface ImageInputStreamread in class ImageInputStreamImplIOExceptionpublic boolean isCached()
true since this ImageInputStream
does not cache data in order to allow seeking backwards but it relies on
the underlying InputStream.isCached in interface ImageInputStreamisCached in class ImageInputStreamImpltrue.isCachedMemory(),
isCachedFile()public boolean isCachedFile()
false since this ImageInputStream
does not maintain a eraf cache.isCachedFile in interface ImageInputStreamisCachedFile in class ImageInputStreamImplfalse.isCached(),
isCachedMemory()public boolean isCachedMemory()
false since this ImageInputStream
does not maintain a main memory cache.isCachedMemory in interface ImageInputStreamisCachedMemory in class ImageInputStreamImpltrue.isCached(),
isCachedFile()public void close()
throws IOException
ImageInputStreamAdapter. The source
InputStream is not closed.close in interface Closeableclose in interface AutoCloseableclose in interface ImageInputStreamclose in class ImageInputStreamImplIOExceptionpublic void mark()
mark in interface ImageInputStreammark in class ImageInputStreamImplpublic void reset()
throws IOException
reset in interface ImageInputStreamreset in class ImageInputStreamImplIOExceptionpublic static final ImageInputStream getStream(InputStream stream)
public InputStream getTarget()
AccessibleStreamgetTarget in interface AccessibleStream<InputStream>public Class<InputStream> getBinding()
AccessibleStreamgetBinding in interface AccessibleStream<InputStream>Copyright © 2006–2019 GeoSolutions. All rights reserved.