|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
net.sourceforge.groboutils.util.io.v1.MimeInputStream
java.io.FilterInputStream implementation for Mime base 64. Not incredibly efficient, but it works and is small. All we need to implement are: read(int) read( byte b[], int off, int len ) skip( long n ) - for translating the # of bytes to skip into mime bytes (4-to-3 ratio) available() - for the same reason as skip
Field Summary |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
MimeInputStream(java.io.InputStream i)
Constructor! |
Method Summary | |
int |
available()
Returns the number of bytes that can be read from this input stream without blocking. |
int |
read()
Write the specified byte , performing mime encoding. |
long |
skip(long n)
Skips over and discards n bytes of data from the
input stream. |
Methods inherited from class java.io.FilterInputStream |
close, mark, markSupported, read, read, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MimeInputStream(java.io.InputStream i)
Method Detail |
public int read() throws java.io.IOException
byte
, performing mime encoding.
Override this method, since all other write methods call it.
java.io.IOException
- If an I/O error occurspublic long skip(long n) throws java.io.IOException
n
bytes of data from the
input stream. The skip
method may, for a variety of
reasons, end up skipping over some smaller number of bytes,
possibly 0
. The actual number of bytes skipped is
returned.
This method performs in.skip(n)
, followed by a quick
translation to mime size.
n
- the number of bytes to be skipped.
java.io.IOException
- if an I/O error occurs.public int available() throws java.io.IOException
This method performs in.available(n)
, does the mime-size
conversion, and returns the result.
java.io.IOException
- if an I/O error occurs.FilterInputStream.in
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |