it.tidalwave.imageio.io
Class RAWImageInputStream

java.lang.Object
  extended by javax.imageio.stream.ImageInputStreamImpl
      extended by it.tidalwave.imageio.io.RAWImageInputStream
All Implemented Interfaces:
java.io.DataInput, javax.imageio.stream.ImageInputStream
Direct Known Subclasses:
CRWImageInputStream, SRFImageInputStream

public class RAWImageInputStream
extends javax.imageio.stream.ImageInputStreamImpl

Version:
CVS $Id: RAWImageInputStream.java,v 1.3 2006/02/15 00:00:53 fabriziogiudici Exp $
Author:
fritz

Field Summary
protected  javax.imageio.stream.ImageInputStream delegate
           
 
Fields inherited from class javax.imageio.stream.ImageInputStreamImpl
bitOffset, byteOrder, flushedPos, streamPos
 
Constructor Summary
RAWImageInputStream(javax.imageio.stream.ImageInputStream delegate)
           
 
Method Summary
 void close()
           
 void flush()
           
 void flushBefore(long pos)
           
 long getBaseOffset()
           
 int getBitOffset()
           
 long getFlushedPosition()
           
 long getStreamPosition()
           
 boolean isCached()
           
 boolean isCachedFile()
           
 boolean isCachedMemory()
           
 long length()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 int readBit()
           
 long readBits(int numBits)
           
 int readComplementedBits(int bitsToGet)
          Read another string of bits.
 void seek(long pos)
           
 void selectBitReader(int bitCount, int bufferSize)
           
 void setBaseOffset(long baseOffset)
           
 void setBitOffset(int bitOffset)
           
 void setDontClose()
           
 void setSkipZeroAfterFF(boolean b)
           
 void skipBits(int bitsToSkip)
           
 int skipBytes(int n)
           
 long skipBytes(long n)
           
 
Methods inherited from class javax.imageio.stream.ImageInputStreamImpl
checkClosed, finalize, getByteOrder, mark, read, readBoolean, readByte, readBytes, readChar, readDouble, readFloat, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedInt, readUnsignedShort, readUTF, reset, setByteOrder
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected javax.imageio.stream.ImageInputStream delegate
Constructor Detail

RAWImageInputStream

public RAWImageInputStream(javax.imageio.stream.ImageInputStream delegate)
Parameters:
delegate -
Method Detail

setBaseOffset

public void setBaseOffset(long baseOffset)
Parameters:
baseOffset -

getBaseOffset

public long getBaseOffset()
Returns:

selectBitReader

public void selectBitReader(int bitCount,
                            int bufferSize)
Parameters:
bitCount -
bufferSize -

setSkipZeroAfterFF

public void setSkipZeroAfterFF(boolean b)
Parameters:
b -

readComplementedBits

public final int readComplementedBits(int bitsToGet)
                               throws java.io.IOException
Read another string of bits. If the most significant bits of the read string is 1, the 2-complement value is returned. This operation is frequently needed by some RAW formats.

Parameters:
bitsToGet - how many bits to read
Returns:
the bits as an integer
Throws:
java.io.IOException - if any I/O error occurs

skipBits

public final void skipBits(int bitsToSkip)
                    throws java.io.IOException
Parameters:
bitsToSkip -
Throws:
java.io.IOException

readBit

public final int readBit()
                  throws java.io.IOException
Specified by:
readBit in interface javax.imageio.stream.ImageInputStream
Overrides:
readBit in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

readBits

public final long readBits(int numBits)
                    throws java.io.IOException
Specified by:
readBits in interface javax.imageio.stream.ImageInputStream
Overrides:
readBits in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

seek

public void seek(long pos)
          throws java.io.IOException
Specified by:
seek in interface javax.imageio.stream.ImageInputStream
Overrides:
seek in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

getStreamPosition

public long getStreamPosition()
                       throws java.io.IOException
Specified by:
getStreamPosition in interface javax.imageio.stream.ImageInputStream
Overrides:
getStreamPosition in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

getBitOffset

public int getBitOffset()
                 throws java.io.IOException
Specified by:
getBitOffset in interface javax.imageio.stream.ImageInputStream
Overrides:
getBitOffset in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

setBitOffset

public void setBitOffset(int bitOffset)
                  throws java.io.IOException
Specified by:
setBitOffset in interface javax.imageio.stream.ImageInputStream
Overrides:
setBitOffset in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Specified by:
read in interface javax.imageio.stream.ImageInputStream
Specified by:
read in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Specified by:
read in interface javax.imageio.stream.ImageInputStream
Specified by:
read in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

length

public long length()
Specified by:
length in interface javax.imageio.stream.ImageInputStream
Overrides:
length in class javax.imageio.stream.ImageInputStreamImpl

skipBytes

public int skipBytes(int n)
              throws java.io.IOException
Specified by:
skipBytes in interface java.io.DataInput
Specified by:
skipBytes in interface javax.imageio.stream.ImageInputStream
Overrides:
skipBytes in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

skipBytes

public long skipBytes(long n)
               throws java.io.IOException
Specified by:
skipBytes in interface javax.imageio.stream.ImageInputStream
Overrides:
skipBytes in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

flushBefore

public void flushBefore(long pos)
                 throws java.io.IOException
Specified by:
flushBefore in interface javax.imageio.stream.ImageInputStream
Overrides:
flushBefore in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface javax.imageio.stream.ImageInputStream
Overrides:
flush in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

getFlushedPosition

public long getFlushedPosition()
Specified by:
getFlushedPosition in interface javax.imageio.stream.ImageInputStream
Overrides:
getFlushedPosition in class javax.imageio.stream.ImageInputStreamImpl

isCached

public boolean isCached()
Specified by:
isCached in interface javax.imageio.stream.ImageInputStream
Overrides:
isCached in class javax.imageio.stream.ImageInputStreamImpl

isCachedMemory

public boolean isCachedMemory()
Specified by:
isCachedMemory in interface javax.imageio.stream.ImageInputStream
Overrides:
isCachedMemory in class javax.imageio.stream.ImageInputStreamImpl

isCachedFile

public boolean isCachedFile()
Specified by:
isCachedFile in interface javax.imageio.stream.ImageInputStream
Overrides:
isCachedFile in class javax.imageio.stream.ImageInputStreamImpl

close

public void close()
           throws java.io.IOException
Specified by:
close in interface javax.imageio.stream.ImageInputStream
Overrides:
close in class javax.imageio.stream.ImageInputStreamImpl
Throws:
java.io.IOException

setDontClose

public void setDontClose()