Class UUEncoderStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.sun.xml.messaging.saaj.packaging.mime.util.UUEncoderStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class UUEncoderStream extends FilterOutputStream
This class implements a UUEncoder. It is implemented as a FilterOutputStream, so one can just wrap this class around any output stream and write bytes into this filter. The Encoding is done as the bytes are written out.- Author:
- John Mani
-
-
Field Summary
Fields Modifier and Type Field Description protected intmodeprotected Stringname-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description UUEncoderStream(OutputStream out)Create a UUencoder that encodes the specified input streamUUEncoderStream(OutputStream out, String name)Create a UUencoder that encodes the specified input streamUUEncoderStream(OutputStream out, String name, int mode)Create a UUencoder that encodes the specified input stream
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidsetNameMode(String name, int mode)Set up the buffer name and permission mode.voidwrite(byte[] data)voidwrite(byte[] b, int off, int len)voidwrite(int c)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Field Detail
-
name
protected String name
-
mode
protected int mode
-
-
Constructor Detail
-
UUEncoderStream
public UUEncoderStream(OutputStream out)
Create a UUencoder that encodes the specified input stream- Parameters:
out- the output stream
-
UUEncoderStream
public UUEncoderStream(OutputStream out, String name)
Create a UUencoder that encodes the specified input stream- Parameters:
out- the output streamname- Specifies a name for the encoded buffer
-
UUEncoderStream
public UUEncoderStream(OutputStream out, String name, int mode)
Create a UUencoder that encodes the specified input stream- Parameters:
out- the output streamname- Specifies a name for the encoded buffermode- Specifies permission mode for the encoded buffer
-
-
Method Detail
-
setNameMode
public void setNameMode(String name, int mode)
Set up the buffer name and permission mode. This method has any effect only if it is invoked before you start writing into the output stream.- Parameters:
name- name to set for the buffer.mode- permission mode.
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
public void write(byte[] data) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
public void write(int c) throws IOException- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classFilterOutputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
-