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

Class UUEncoderStream

FilterOutputStream
|
+--gnu.mail.util.UUEncoderStream


public class UUEncoderStream
extends FilterOutputStream

a stream that performs UU Encoding.
Author:
Andrew Selkirk
See Also:
java.io.FilterOutputStream

Field Summary

int

mode

Permission mode of file.

String

name

Name of file to be uuencoded.

Constructor Summary

UUEncoderStream(OutputStream stream)

Create a new UU-Encoding stream with the default name "encoder.buf" with the permission mode 644.

UUEncoderStream(OutputStream stream, String name)

Create a new UU-Encoding stream with the default name permission mode 644.

UUEncoderStream(OutputStream stream, String name, int mode)

Create a new UU-Encoding stream.

Method Summary

void

close()

Close stream.

void

flush()

Flush encoding buffer.

void

setNameMode(String name, int mode)

Set the name and mode for this uu encoded stream.

void

write(byte[] bytes, int offset, int length)

Write bytes to encoding stream.

void

write(byte[] bytes)

Write bytes to stream.

void

write(int b)

Write a byte to the stream.

Field Details

mode

protected int mode

Permission mode of file.


name

protected String name

Name of file to be uuencoded.

Constructor Details

UUEncoderStream

public UUEncoderStream(OutputStream stream, String name, int mode)

Create a new UU-Encoding stream.

Parameters:
stream - Output stream
name - File name
mode - File permission mode

UUEncoderStream

public UUEncoderStream(OutputStream stream, String name)

Create a new UU-Encoding stream with the default name permission mode 644.

Parameters:
stream - Output stream
name - File name

UUEncoderStream

public UUEncoderStream(OutputStream stream)

Create a new UU-Encoding stream with the default name "encoder.buf" with the permission mode 644.

Parameters:
stream - Output stream

Method Details

close

public void close()

Close stream.

Throws:
- IO Exception occurred

flush

public void flush()

Flush encoding buffer.

Throws:
- IO Exception occurred

setNameMode

public void setNameMode(String name, int mode)

Set the name and mode for this uu encoded stream. Note that this is only valid before data has been uuencoded as this information is written at the beginning of the stream.

Parameters:
name - File name
mode - Permission mode

write

public void write(byte[] bytes, int offset, int length)

Write bytes to encoding stream.

Parameters:
bytes - Byte array to read values from
offset - Offset to start reading bytes from
length - Number of bytes to read
Throws:
- IO Exception occurred

write

public void write(byte[] bytes)

Write bytes to stream.

Parameters:
bytes - Byte array to write to stream
Throws:
- IO Exception occurred

write

public void write(int b)

Write a byte to the stream.

Parameters:
b - Byte to write to the stream
Throws:
- IO Exception occurred