org.icepdf.core.io
Class ZeroPaddedInputStream
java.lang.Object
java.io.InputStream
org.icepdf.core.io.ZeroPaddedInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class ZeroPaddedInputStream
- extends java.io.InputStream
When decoding CCITTFaxDecode images via JAI, we sometimes have
to zero pad the input data, otherwise JAI will fail instead
of it gracefully assuming zero data itself.
As well, with some inline images, we can have some trailing
whitespace that should be removed.
It's typical to have to remove the whitespace and add the zeros.
- Since:
- 2.2
- Author:
- Mark Collette
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZeroPaddedInputStream
public ZeroPaddedInputStream(java.io.InputStream in)
read
public int read()
throws java.io.IOException
- Specified by:
read in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] buffer)
throws java.io.IOException
- Overrides:
read in class java.io.InputStream
- Throws:
java.io.IOException
read
public int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
- Overrides:
read in class java.io.InputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.InputStream
- Throws:
java.io.IOException
available
public int available()
throws java.io.IOException
- Overrides:
available in class java.io.InputStream
- Throws:
java.io.IOException
mark
public void mark(int readLimit)
- Overrides:
mark in class java.io.InputStream
markSupported
public boolean markSupported()
- Overrides:
markSupported in class java.io.InputStream
reset
public void reset()
throws java.io.IOException
- Overrides:
reset in class java.io.InputStream
- Throws:
java.io.IOException
skip
public long skip(long n)
throws java.io.IOException
- Overrides:
skip in class java.io.InputStream
- Throws:
java.io.IOException