gnu.mail.util

Class UUDecoderStream


public class UUDecoderStream
extends FilterInputStream

A stream that does UU Decoding. UU-Decoding is defined in the MIME rfcs.

Field Summary

protected int
mode
permission mode of file.
protected String
name
name of file to be uudecoded.

Constructor Summary

UUDecoderStream(InputStream in)
create a new UU-Decoding stream.

Method Summary

int
available()
int
getMode()
get mode from UU-Decoding.
String
getName()
boolean
markSupported()
int
read()
Read byte from decoded buffer.
int
read(byte[] bytes, int offset, int length)
Read byte from decoded buffer.

Field Details

mode

protected int mode
permission mode of file.


name

protected String name
name of file to be uudecoded.

Constructor Details

UUDecoderStream

public UUDecoderStream(InputStream in)
create a new UU-Decoding stream.

Parameters:

Method Details

available

public int available()
            throws IOException

Returns:
the number of bytes that are available that will not block.


getMode

public int getMode()
            throws IOException
get mode from UU-Decoding.

Returns:
File permission mode


getName

public String getName()
            throws IOException

Returns:
Name of file


markSupported

public boolean markSupported()

Returns:
false because mark is not supported in UU Decoding.


read

public int read()
            throws IOException
Read byte from decoded buffer. If buffer empty, the next line of encoded bytes is read and decoded.

Returns:
next byte


read

public int read(byte[] bytes,
                int offset,
                int length)
            throws IOException
Read byte from decoded buffer. If buffer empty, the next line of encoded bytes is read and decoded.

Parameters:
bytes - Byte array to write bytes into
offset - Offset of array to write
length - Number of bytes to write

Returns:
Number of bytes read