gnu.mail.util
Class UUEncoderStream
FilterOutputStream
gnu.mail.util.UUEncoderStream
public class UUEncoderStream
extends FilterOutputStream
a stream that performs UU Encoding.
java.io.FilterOutputStream
protected int | mode - Permission mode of file.
|
protected String | name - Name of file to be uuencoded.
|
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.
|
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) - Write bytes to stream.
|
void | write(byte[] bytes, int offset, int length) - Write bytes to encoding stream.
|
void | write(int b) - Write a byte to the stream.
|
mode
protected int mode
Permission mode of file.
name
protected String name
Name of file to be uuencoded.
UUEncoderStream
public UUEncoderStream(OutputStream stream)
Create a new UU-Encoding stream with the default name
"encoder.buf" with the permission mode 644.
stream
- Output stream
UUEncoderStream
public UUEncoderStream(OutputStream stream,
String name)
Create a new UU-Encoding stream with the default name
permission mode 644.
stream
- Output streamname
- File name
UUEncoderStream
public UUEncoderStream(OutputStream stream,
String name,
int mode)
Create a new UU-Encoding stream.
stream
- Output streamname
- File namemode
- File permission mode
close
public void close()
throws IOException
Close stream.
flush
public void flush()
throws IOException
Flush encoding buffer.
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.
name
- File namemode
- Permission mode
write
public void write(byte[] bytes)
throws IOException
Write bytes to stream.
bytes
- Byte array to write to stream
write
public void write(byte[] bytes,
int offset,
int length)
throws IOException
Write bytes to encoding stream.
bytes
- Byte array to read values fromoffset
- Offset to start reading bytes fromlength
- Number of bytes to read
write
public void write(int b)
throws IOException
Write a byte to the stream.
b
- Byte to write to the stream