Java Doc for ImageInputStreamImpl.java in  » 6.0-JDK-Core » image » javax » imageio » stream » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » image » javax.imageio.stream 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.imageio.stream.ImageInputStreamImpl

All known Subclasses:   javax.imageio.stream.ImageOutputStreamImpl,  javax.imageio.stream.FileCacheImageInputStream,  javax.imageio.stream.MemoryCacheImageInputStream,  javax.imageio.stream.FileImageInputStream,
ImageInputStreamImpl
abstract public class ImageInputStreamImpl implements ImageInputStream(Code)
An abstract class implementing the ImageInputStream interface. This class is designed to reduce the number of methods that must be implemented by subclasses.

In particular, this class handles most or all of the details of byte order interpretation, buffering, mark/reset, discarding, closing, and disposing.



Field Summary
protected  intbitOffset
     The current bit offset within the stream.
 byte[]byteBuf
     Byte buffer used for readFully(type[], int, int).
protected  ByteOrderbyteOrder
     The byte order of the stream as an instance of the enumeration class java.nio.ByteOrder, where ByteOrder.BIG_ENDIAN indicates network byte order and ByteOrder.LITTLE_ENDIAN indicates the reverse order.
protected  longflushedPos
     The position prior to which data may be discarded.
protected  longstreamPos
     The current read position within the stream.

Constructor Summary
public  ImageInputStreamImpl()
     Constructs an ImageInputStreamImpl.

Method Summary
final protected  voidcheckClosed()
     Throws an IOException if the stream has been closed.
public  voidclose()
    
protected  voidfinalize()
     Finalizes this object prior to garbage collection.
public  voidflush()
    
public  voidflushBefore(long pos)
    
public  intgetBitOffset()
    
public  ByteOrdergetByteOrder()
    
public  longgetFlushedPosition()
    
public  longgetStreamPosition()
    
public  booleanisCached()
     Default implementation returns false.
public  booleanisCachedFile()
     Default implementation returns false.
public  booleanisCachedMemory()
     Default implementation returns false.
public  longlength()
     Returns -1L to indicate that the stream has unknown length.
public  voidmark()
     Pushes the current stream position onto a stack of marked positions.
abstract public  intread()
     Reads a single byte from the stream and returns it as an int between 0 and 255.
public  intread(byte[] b)
     A convenience method that calls read(b, 0, b.length).
abstract public  intread(byte[] b, int off, int len)
     Reads up to len bytes from the stream, and stores them into b starting at index off. If no bytes can be read because the end of the stream has been reached, -1 is returned.

The bit offset within the stream must be reset to zero before the read occurs.

Subclasses must provide an implementation for this method. The subclass implementation should update the stream position before exiting.

public  intreadBit()
    
public  longreadBits(int numBits)
    
public  booleanreadBoolean()
    
public  bytereadByte()
    
public  voidreadBytes(IIOByteBuffer buf, int len)
    
public  charreadChar()
    
public  doublereadDouble()
    
public  floatreadFloat()
    
public  voidreadFully(byte[] b, int off, int len)
    
public  voidreadFully(byte[] b)
    
public  voidreadFully(short[] s, int off, int len)
    
public  voidreadFully(char[] c, int off, int len)
    
public  voidreadFully(int[] i, int off, int len)
    
public  voidreadFully(long[] l, int off, int len)
    
public  voidreadFully(float[] f, int off, int len)
    
public  voidreadFully(double[] d, int off, int len)
    
public  intreadInt()
    
public  StringreadLine()
    
public  longreadLong()
    
public  shortreadShort()
    
public  StringreadUTF()
    
public  intreadUnsignedByte()
    
public  longreadUnsignedInt()
    
public  intreadUnsignedShort()
    
public  voidreset()
     Resets the current stream byte and bit positions from the stack of marked positions.
public  voidseek(long pos)
    
public  voidsetBitOffset(int bitOffset)
    
public  voidsetByteOrder(ByteOrder byteOrder)
    
public  intskipBytes(int n)
     Advances the current stream position by calling seek(getStreamPosition() + n).

The bit offset is reset to zero.
Parameters:
  n - the number of bytes to seek forward.

public  longskipBytes(long n)
     Advances the current stream position by calling seek(getStreamPosition() + n).

The bit offset is reset to zero.
Parameters:
  n - the number of bytes to seek forward.


Field Detail
bitOffset
protected int bitOffset(Code)
The current bit offset within the stream. Subclasses are responsible for keeping this value current from any method they override that alters the bit offset.



byteBuf
byte[] byteBuf(Code)
Byte buffer used for readFully(type[], int, int). Note that this array is also used for bulk reads in readShort(), readInt(), etc, so it should be large enough to hold a primitive value (i.e. >= 8 bytes). Also note that this array is package protected, so that it can be used by ImageOutputStreamImpl in a similar manner.



byteOrder
protected ByteOrder byteOrder(Code)
The byte order of the stream as an instance of the enumeration class java.nio.ByteOrder, where ByteOrder.BIG_ENDIAN indicates network byte order and ByteOrder.LITTLE_ENDIAN indicates the reverse order. By default, the value is ByteOrder.BIG_ENDIAN.



flushedPos
protected long flushedPos(Code)
The position prior to which data may be discarded. Seeking to a smaller position is not allowed. flushedPos will always be >= 0.



streamPos
protected long streamPos(Code)
The current read position within the stream. Subclasses are responsible for keeping this value current from any method they override that alters the read position.




Constructor Detail
ImageInputStreamImpl
public ImageInputStreamImpl()(Code)
Constructs an ImageInputStreamImpl.




Method Detail
checkClosed
final protected void checkClosed() throws IOException(Code)
Throws an IOException if the stream has been closed. Subclasses may call this method from any of their methods that require the stream not to be closed.
exception:
  IOException - if the stream is closed.



close
public void close() throws IOException(Code)



finalize
protected void finalize() throws Throwable(Code)
Finalizes this object prior to garbage collection. The close method is called to close any open input source. This method should not be called from application code.
exception:
  Throwable - if an error occurs during superclassfinalization.



flush
public void flush() throws IOException(Code)



flushBefore
public void flushBefore(long pos) throws IOException(Code)



getBitOffset
public int getBitOffset() throws IOException(Code)



getByteOrder
public ByteOrder getByteOrder()(Code)



getFlushedPosition
public long getFlushedPosition()(Code)



getStreamPosition
public long getStreamPosition() throws IOException(Code)



isCached
public boolean isCached()(Code)
Default implementation returns false. Subclasses should override this if they cache data.



isCachedFile
public boolean isCachedFile()(Code)
Default implementation returns false. Subclasses should override this if they cache data in a temporary file.



isCachedMemory
public boolean isCachedMemory()(Code)
Default implementation returns false. Subclasses should override this if they cache data in main memory.



length
public long length()(Code)
Returns -1L to indicate that the stream has unknown length. Subclasses must override this method to provide actual length information. -1L to indicate unknown length.



mark
public void mark()(Code)
Pushes the current stream position onto a stack of marked positions.



read
abstract public int read() throws IOException(Code)
Reads a single byte from the stream and returns it as an int between 0 and 255. If EOF is reached, -1 is returned.

Subclasses must provide an implementation for this method. The subclass implementation should update the stream position before exiting.

The bit offset within the stream must be reset to zero before the read occurs. the value of the next byte in the stream, or -1if EOF is reached.
exception:
  IOException - if the stream has been closed.




read
public int read(byte[] b) throws IOException(Code)
A convenience method that calls read(b, 0, b.length).

The bit offset within the stream is reset to zero before the read occurs. the number of bytes actually read, or -1to indicate EOF.
exception:
  NullPointerException - if b isnull.
exception:
  IOException - if an I/O error occurs.




read
abstract public int read(byte[] b, int off, int len) throws IOException(Code)
Reads up to len bytes from the stream, and stores them into b starting at index off. If no bytes can be read because the end of the stream has been reached, -1 is returned.

The bit offset within the stream must be reset to zero before the read occurs.

Subclasses must provide an implementation for this method. The subclass implementation should update the stream position before exiting.
Parameters:
  b - an array of bytes to be written to.
Parameters:
  off - the starting position within b to write to.
Parameters:
  len - the maximum number of bytes to read. the number of bytes actually read, or -1to indicate EOF.
exception:
  IndexOutOfBoundsException - if off isnegative, len is negative, or off +len is greater than b.length.
exception:
  NullPointerException - if b isnull.
exception:
  IOException - if an I/O error occurs.




readBit
public int readBit() throws IOException(Code)



readBits
public long readBits(int numBits) throws IOException(Code)



readBoolean
public boolean readBoolean() throws IOException(Code)



readByte
public byte readByte() throws IOException(Code)



readBytes
public void readBytes(IIOByteBuffer buf, int len) throws IOException(Code)



readChar
public char readChar() throws IOException(Code)



readDouble
public double readDouble() throws IOException(Code)



readFloat
public float readFloat() throws IOException(Code)



readFully
public void readFully(byte[] b, int off, int len) throws IOException(Code)



readFully
public void readFully(byte[] b) throws IOException(Code)



readFully
public void readFully(short[] s, int off, int len) throws IOException(Code)



readFully
public void readFully(char[] c, int off, int len) throws IOException(Code)



readFully
public void readFully(int[] i, int off, int len) throws IOException(Code)



readFully
public void readFully(long[] l, int off, int len) throws IOException(Code)



readFully
public void readFully(float[] f, int off, int len) throws IOException(Code)



readFully
public void readFully(double[] d, int off, int len) throws IOException(Code)



readInt
public int readInt() throws IOException(Code)



readLine
public String readLine() throws IOException(Code)



readLong
public long readLong() throws IOException(Code)



readShort
public short readShort() throws IOException(Code)



readUTF
public String readUTF() throws IOException(Code)



readUnsignedByte
public int readUnsignedByte() throws IOException(Code)



readUnsignedInt
public long readUnsignedInt() throws IOException(Code)



readUnsignedShort
public int readUnsignedShort() throws IOException(Code)



reset
public void reset() throws IOException(Code)
Resets the current stream byte and bit positions from the stack of marked positions.

An IOException will be thrown if the previous marked position lies in the discarded portion of the stream.
exception:
  IOException - if an I/O error occurs.




seek
public void seek(long pos) throws IOException(Code)



setBitOffset
public void setBitOffset(int bitOffset) throws IOException(Code)



setByteOrder
public void setByteOrder(ByteOrder byteOrder)(Code)



skipBytes
public int skipBytes(int n) throws IOException(Code)
Advances the current stream position by calling seek(getStreamPosition() + n).

The bit offset is reset to zero.
Parameters:
  n - the number of bytes to seek forward. an int representing the number of bytesskipped.
exception:
  IOException - if getStreamPositionthrows an IOException when computing eitherthe starting or ending position.




skipBytes
public long skipBytes(long n) throws IOException(Code)
Advances the current stream position by calling seek(getStreamPosition() + n).

The bit offset is reset to zero.
Parameters:
  n - the number of bytes to seek forward. a long representing the number of bytesskipped.
exception:
  IOException - if getStreamPositionthrows an IOException when computing eitherthe starting or ending position.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.