|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
org.spaceroots.jarmor.UUEncoder
This class encodes a binary stream into a text stream.
The UU encoding is suitable when binary data needs to be transmitted or stored as text. It was used to send binary data through UUCP (Unix to Unix Copy Protocol). The encoded text uses a subset of the ASCII character set.
The encoded stream is about 38% larger than the corresponding binary stream (6 binary bits are converted into 8 encoded bits, there are stream header and trailer, and each 60 encoded bytes chunk is started by a control character and ended by a newline).
UUDecoder| Field Summary | |
static int |
EXECUTE
Bit-pattern for EXECUTE permission. |
static int |
READ
Bit-pattern for READ permission. |
static int |
WRITE
Bit-pattern for WRITE permission. |
| Fields inherited from class java.io.FilterOutputStream |
out |
| Constructor Summary | |
UUEncoder(OutputStream out)
Create an encoder wrapping a sink of binary data. |
|
UUEncoder(OutputStream out,
String name,
int userPerms,
int groupPerms,
int othersPerms)
Create an encoder wrapping a sink of binary data. |
|
| Method Summary | |
void |
close()
Closes this output stream and releases any system resources associated with the stream. |
void |
write(int b)
Writes the specified byte to this output stream. |
| Methods inherited from class java.io.FilterOutputStream |
flush, write, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int READ
public static final int WRITE
public static final int EXECUTE
| Constructor Detail |
public UUEncoder(OutputStream out)
The encoder built will have a default name of "decoded.data"
and default permissions set to READ|WRITE for the
user, READ for the group and READ for
others.
out - sink of binary data to filter
public UUEncoder(OutputStream out,
String name,
int userPerms,
int groupPerms,
int othersPerms)
The name and the various permission listed here are relevant
if the data is to be stored on a file once decoded. The permissions
are specified by or-ing together the desired bits patterns
READ, WRITE and EXECUTE.
out - sink of binary data to filtername - name of the data fileuserPerms - access permission for the user (owner)groupPerms - access permission for the groupothersPerms - access permission for others| Method Detail |
public void close()
throws IOException
IOException - if the underlying stream throws one
public void write(int b)
throws IOException
b - byte to write (only the 8 low order bits are used)
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||