⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
gnu.mail.util

Class UUDecoderStream

FilterInputStream
|
+--gnu.mail.util.UUDecoderStream


public class UUDecoderStream
extends FilterInputStream

A stream that does UU Decoding. UU-Decoding is defined in the MIME rfcs.
Authors:
Andrew Selkirk: aselkirk@mailandnews.com
Nic Ferrier: nferrier@tapsellferrier.co.uk

Field Summary

int

mode

permission mode of file.

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:
in - Input stream

Method Details

available

public int available()

Returns:
the number of bytes that are available that will not block.
Throws:
- IO Exception occurred

getMode

public int getMode()

get mode from UU-Decoding.

Returns:
File permission mode
Throws:
- IO Exception occurred

getName

public String getName()

Returns:
Name of file
Throws:
- IO Exception occurred

markSupported

public boolean markSupported()

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

read

public int read()

Read byte from decoded buffer. If buffer empty, the next line of encoded bytes is read and decoded.

Returns:
next byte
Throws:
- IO Exception occurred

read

public int read(byte[] bytes, int offset, int length)

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
Throws:
- IO Exception occurred