Top Description Fields Constructors Methods
org.apache.tools.ant.util

public Class UUEncoder

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, .OutputStream, .PrintStream

UUEncoding of an input stream placed into an OutputStream. This class is meant to be a drop in replacement for sun.misc.UUEncoder, which was previously used by Ant. The uuencode algorithm code has been copied from the geronimo project.

Field Summary

Modifier and TypeField and Description
protected static final int
private static final int
private static final int
private String
private OutputStream

Constructor Summary

AccessConstructor and Description
public
UUEncoder(String
the name of the encoded buffer.
name
)

Constructor specifying a name for the encoded buffer, begin line will be:

  begin 644 [NAME]

Method Summary

Modifier and TypeMethod and Description
public void
encode(InputStream
the input stream.
is
,
OutputStream
the output stream.
out
)

UUEncode bytes from the input stream, and write them as text characters to the output stream.

private void
private void
private void
encodeLine(byte[]
The array of byte data.
data
,
int
The starting offset within the data.
offset
,
int
Length of the data to encode.
length
,
OutputStream
The output stream the encoded data is written to.
out
)

Encode a single line of data (less than or equal to 45 characters).

private void
encodeString(String n)

Encode a string to the output.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_MODEback to summary
protected static final int DEFAULT_MODE
INPUT_BUFFER_SIZEback to summary
private static final int INPUT_BUFFER_SIZE
MAX_CHARS_PER_LINEback to summary
private static final int MAX_CHARS_PER_LINE
nameback to summary
private String name
outback to summary
private OutputStream out

Constructor Detail

UUEncoderback to summary
public UUEncoder(String name)

Constructor specifying a name for the encoded buffer, begin line will be:

  begin 644 [NAME]
Parameters
name:String

the name of the encoded buffer.

Method Detail

encodeback to summary
public void encode(InputStream is, OutputStream out) throws IOException

UUEncode bytes from the input stream, and write them as text characters to the output stream. This method will run until it exhausts the input stream.

Parameters
is:InputStream

the input stream.

out:OutputStream

the output stream.

Exceptions
IOException:
if there is an error.
encodeBeginback to summary
private void encodeBegin()
encodeEndback to summary
private void encodeEnd()
encodeLineback to summary
private void encodeLine(byte[] data, int offset, int length, OutputStream out) throws IOException

Encode a single line of data (less than or equal to 45 characters).

Parameters
data:byte[]

The array of byte data.

offset:int

The starting offset within the data.

length:int

Length of the data to encode.

out:OutputStream

The output stream the encoded data is written to.

Exceptions
IOException:
if something goes wrong
encodeStringback to summary
private void encodeString(String n)

Encode a string to the output.