|
||||||||||
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 . |
static ImageInputStream |
getStream(InputStream stream)
|
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 ImageInputStream
read
in class ImageInputStreamImpl
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in interface ImageInputStream
read
in class ImageInputStreamImpl
IOException
public 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 ImageInputStream
isCached
in class ImageInputStreamImpl
true
.isCachedMemory()
,
isCachedFile()
public boolean isCachedFile()
false
since this ImageInputStream
does not maintain a eraf cache.
isCachedFile
in interface ImageInputStream
isCachedFile
in class ImageInputStreamImpl
false
.isCached()
,
isCachedMemory()
public boolean isCachedMemory()
false
since this ImageInputStream
does not maintain a main memory cache.
isCachedMemory
in interface ImageInputStream
isCachedMemory
in class ImageInputStreamImpl
true
.isCached()
,
isCachedFile()
public void close() throws IOException
ImageInputStreamAdapter
. The source
InputStream
is not closed.
close
in interface ImageInputStream
close
in class ImageInputStreamImpl
IOException
public void mark()
mark
in interface ImageInputStream
mark
in class ImageInputStreamImpl
public void reset() throws IOException
reset
in interface ImageInputStream
reset
in class ImageInputStreamImpl
IOException
public static final ImageInputStream getStream(InputStream stream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |