public class UUEncoderStream
extends java.io.FilterOutputStream
Modifier and Type | Field and Description |
---|---|
private byte[] |
buffer |
private int |
bufsize |
private int |
mode |
private java.lang.String |
name |
private boolean |
wrotePrefix |
private boolean |
wroteSuffix |
Constructor and Description |
---|
UUEncoderStream(java.io.OutputStream out)
Create a UUencoder that encodes the specified input stream
|
UUEncoderStream(java.io.OutputStream out,
java.lang.String name)
Create a UUencoder that encodes the specified input stream
|
UUEncoderStream(java.io.OutputStream out,
java.lang.String name,
int mode)
Create a UUencoder that encodes the specified input stream
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
encode()
Encode a line.
|
void |
flush() |
void |
setNameMode(java.lang.String name,
int mode)
Set up the buffer name and permission mode.
|
void |
write(byte[] data) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int c) |
private void |
writePrefix()
Write out the prefix: "begin
|
private void |
writeSuffix()
Write a single line containing space and the suffix line
containing the single word "end" (terminated by a newline)
|
private byte[] buffer
private int bufsize
private boolean wrotePrefix
private boolean wroteSuffix
private java.lang.String name
private int mode
public UUEncoderStream(java.io.OutputStream out)
out
- the output streampublic UUEncoderStream(java.io.OutputStream out, java.lang.String name)
out
- the output streamname
- Specifies a name for the encoded bufferpublic UUEncoderStream(java.io.OutputStream out, java.lang.String name, int mode)
out
- the output streamname
- Specifies a name for the encoded buffermode
- Specifies permission mode for the encoded bufferpublic void setNameMode(java.lang.String name, int mode)
name
- the buffer namemode
- the permission modepublic void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void write(byte[] data) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void write(int c) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.FilterOutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.FilterOutputStream
java.io.IOException
private void writePrefix() throws java.io.IOException
java.io.IOException
private void writeSuffix() throws java.io.IOException
java.io.IOException
private void encode() throws java.io.IOException
java.io.IOException