net.freeutils.tnef

Class TNEFInputStream

public class TNEFInputStream extends Object

The TNEFInputStream class provides low-level access to a TNEF stream.

Since: 2003-07-25

Constructor Summary
TNEFInputStream(InputStream in)
Constructs a TNEFInputStream whose content is retrieved from the given InputStream.
TNEFInputStream(File file)
Constructs a TNEFInputStream whose content is retrieved from the given File.
TNEFInputStream(String filename)
Constructs a TNEFInputStream whose content is retrieved from the given file.
Method Summary
voidclose()
Closes the TNEFInputStream and underlying InputStream.
intgetKey()
Returns the TNEF stream key.
AttrreadAttr()
Reads a TNEF attribute from the stream.
protected intreadU16()
Reads a 16-bit unsigned value from the stream.
protected longreadU32()
Reads a 32-bit unsigned value from the stream.
protected intreadU8()
Reads an 8-bit unsigned value from the stream.

Constructor Detail

TNEFInputStream

public TNEFInputStream(InputStream in)
Constructs a TNEFInputStream whose content is retrieved from the given InputStream.

Parameters: in an InputStream supplying a TNEF data stream

Throws: IOException if the input does not start with a valid TNEF signature, or if an I/O error occurs

TNEFInputStream

public TNEFInputStream(File file)
Constructs a TNEFInputStream whose content is retrieved from the given File.

Parameters: file a file containing a TNEF data stream

Throws: IOException if the input does not start with a valid TNEF signature, or if an I/O error occurs

TNEFInputStream

public TNEFInputStream(String filename)
Constructs a TNEFInputStream whose content is retrieved from the given file.

Parameters: filename the fully qualified filename of a file containing a TNEF data stream

Throws: IOException if the input does not start with a valid TNEF signature, or if an I/O error occurs

Method Detail

close

public void close()
Closes the TNEFInputStream and underlying InputStream.

Throws: IOException if an I/O error occurs

getKey

public int getKey()
Returns the TNEF stream key.

Returns: the TNEF stream key

readAttr

public Attr readAttr()
Reads a TNEF attribute from the stream.

Returns: a TNEF attribute read from the stream, or null if the stream end is reached

Throws: IOException if the stream does not contain a valid TNEF attribute, or if an I/O error occurs

readU16

protected int readU16()
Reads a 16-bit unsigned value from the stream.

Returns: a 16-bit unsigned value read from the stream

Throws: IOException if the stream end is reached, or if an I/O error occurs

readU32

protected long readU32()
Reads a 32-bit unsigned value from the stream.

Returns: a 32-bit unsigned value read from the stream

Throws: IOException if the stream end is reached, or if an I/O error occurs

readU8

protected int readU8()
Reads an 8-bit unsigned value from the stream.

Returns: an 8-bit unsigned value read from the stream

Throws: IOException if the stream end is reached, or if an I/O error occurs