|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectImageInputStreamImpl
ImageInputStreamAdapter
public class ImageInputStreamAdapter
An implementation of 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.
| Field Summary |
|---|
| Fields inherited from class ImageInputStreamImpl |
|---|
bitOffset, byteOrder, flushedPos, streamPos |
| Constructor Summary | |
|---|---|
ImageInputStreamAdapter(InputStream stream)
Constructs a n ImageInputStreamAdapter that will read from
a given InputStream. |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class ImageInputStreamImpl |
|---|
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, skipBytes |
| Methods inherited from class Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageInputStreamAdapter(InputStream stream)
ImageInputStreamAdapter that will read from
a given InputStream.
is - an InputStream to read from.
IllegalArgumentException - if is is null.| Method Detail |
|---|
public int read()
throws IOException
read in interface ImageInputStreamread in class ImageInputStreamImplIOException
public 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 ImageInputStreamclose in class ImageInputStreamImplIOExceptionpublic void mark()
mark in interface ImageInputStreammark in class ImageInputStreamImpl
public void reset()
throws IOException
reset in interface ImageInputStreamreset in class ImageInputStreamImplIOExceptionpublic static final ImageInputStream getStream(InputStream stream)
public InputStream getTarget()
AccessibleStream
getTarget in interface AccessibleStream<InputStream>public Class<InputStream> getBinding()
AccessibleStream
getBinding in interface AccessibleStream<InputStream>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||