picture.io
Class KnownLengthInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--picture.io.KnownLengthInputStream
- public class KnownLengthInputStream
- extends java.io.FilterInputStream
Input stream which transforms its data via
Run-Length-Decoding.
Fields inherited from class java.io.FilterInputStream |
in |
Method Summary |
int |
available()
Return data from internal ByteArrayInputStream. |
static void |
main(java.lang.String[] args)
|
void |
mark(int readlimit)
Return data from internal ByteArrayInputStream. |
boolean |
markSupported()
Return data from internal ByteArrayInputStream. |
int |
read()
Reads a byte from the underlying input stream. |
int |
read(byte[] b,
int off,
int len)
Reads a byte array. |
void |
reset()
Return data from internal ByteArrayInputStream. |
long |
skip(long n)
Return data from internal ByteArrayInputStream. |
Methods inherited from class java.io.FilterInputStream |
close, read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KnownLengthInputStream
public KnownLengthInputStream(java.io.InputStream in)
- Initialize and set input stream.
read
public int read()
throws java.io.IOException
- Reads a byte from the underlying input stream. If the written
length is exceeded this is treated as EOF.
- Overrides:
read
in class java.io.FilterInputStream
- Returns:
- tranformed byte or -1 for end of file
- Throws:
java.io.IOException
-
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Reads a byte array. If the written length is exceeded this is
treated as EOF.
- Overrides:
read
in class java.io.FilterInputStream
- Parameters:
b
- where to write the bytes tooff
- starting offsetlen
- how many bytes to read- Returns:
- number of bytes bytes actually read
- Throws:
java.io.IOException
-
mark
public void mark(int readlimit)
- Return data from internal ByteArrayInputStream.
- Overrides:
mark
in class java.io.FilterInputStream
reset
public void reset()
- Return data from internal ByteArrayInputStream.
- Overrides:
reset
in class java.io.FilterInputStream
markSupported
public boolean markSupported()
- Return data from internal ByteArrayInputStream.
- Overrides:
markSupported
in class java.io.FilterInputStream
skip
public long skip(long n)
throws java.io.IOException
- Return data from internal ByteArrayInputStream.
- Overrides:
skip
in class java.io.FilterInputStream
available
public int available()
- Return data from internal ByteArrayInputStream.
- Overrides:
available
in class java.io.FilterInputStream
main
public static void main(java.lang.String[] args)
throws java.io.IOException