public class

UUDecoderStream

extends FilterInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ com.google.code.com.sun.mail.util.UUDecoderStream

Class Overview

This class implements a UUDecoder. It is implemented as a FilterInputStream, so one can just wrap this class around any input stream and read bytes from this filter. The decoding is done as the bytes are read out.

Summary

[Expand]
Inherited Constants
From class java.io.InputStream
Fields
private byte[] buffer
private int bufsize
private boolean gotEnd
private boolean gotPrefix
private boolean ignoreErrors
private boolean ignoreMissingBeginEnd
private int index
private LineInputStream lin
private int mode
private String name
private String readAhead
[Expand]
Inherited Fields
From class java.io.FilterInputStream
Public Constructors
UUDecoderStream(InputStream in)
Create a UUdecoder that decodes the specified input stream.
UUDecoderStream(InputStream in, boolean ignoreErrors, boolean ignoreMissingBeginEnd)
Create a UUdecoder that decodes the specified input stream.
Public Methods
int available()
int getMode()
Get the "mode" field from the prefix.
String getName()
Get the "name" field from the prefix.
boolean markSupported()
int read()
Read the next decoded byte from this input stream.
int read(byte[] buf, int off, int len)
[Expand]
Inherited Methods
From class java.io.FilterInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Fields

private byte[] buffer

private int bufsize

private boolean gotEnd

private boolean gotPrefix

private boolean ignoreErrors

private boolean ignoreMissingBeginEnd

private int index

private LineInputStream lin

private int mode

private String name

private String readAhead

Public Constructors

public UUDecoderStream (InputStream in)

Create a UUdecoder that decodes the specified input stream. The System property mail.mime.uudecode.ignoreerrors controls whether errors in the encoded data cause an exception or are ignored. The default is false (errors cause exception). The System property mail.mime.uudecode.ignoremissingbeginend controls whether a missing begin or end line cause an exception or are ignored. The default is false (errors cause exception).

Parameters
in The input stream

public UUDecoderStream (InputStream in, boolean ignoreErrors, boolean ignoreMissingBeginEnd)

Create a UUdecoder that decodes the specified input stream.

Parameters
in The input stream
ignoreErrors Ignore errors?
ignoreMissingBeginEnd Ignore missing begin or end?

Public Methods

public int available ()

Throws
IOException

public int getMode ()

Get the "mode" field from the prefix. This is the permission mode of the source file.

Returns
  • permission mode of source file
Throws
IOException if an I/O error occurs.

public String getName ()

Get the "name" field from the prefix. This is meant to be the pathname of the decoded file

Returns
  • name of decoded file
Throws
IOException if an I/O error occurs.

public boolean markSupported ()

public int read ()

Read the next decoded byte from this input stream. The byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Returns
  • next byte of data, or -1 if the end of stream is reached.
Throws
IOException if an I/O error occurs.
See Also

public int read (byte[] buf, int off, int len)

Parameters
buf
off
len
Throws
IOException