net.freeutils.tnef

Class MAPIValue

public class MAPIValue extends Object

The MAPIProp class encapsulates the value of a MAPI property.

Since: 2003-07-25

Constructor Summary
MAPIValue(int type, RawInputStream data, int length)
Constructs a MAPIValue containing a given value.
Method Summary
byte[]getData()
Gets the MAPIValue data.
intgetLength()
Gets the MAPIValue data length (in bytes).
RawInputStreamgetRawData()
Gets the MAPIValue raw data.
intgetType()
Gets the MAPIValue type.
ObjectgetValue()
Returns the value encapsulated by this MAPIValue.
StringtoString()
Returns a string representation of this object.

Constructor Detail

MAPIValue

public MAPIValue(int type, RawInputStream data, int length)
Constructs a MAPIValue containing a given value.

Parameters: type the value type data the TNEF stream containing the value length the length of the value data (in bytes)

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

Method Detail

getData

public byte[] getData()
Gets the MAPIValue data.

Returns: the MAPIValue data

getLength

public int getLength()
Gets the MAPIValue data length (in bytes).

Returns: the MAPIValue data length (in bytes)

getRawData

public RawInputStream getRawData()
Gets the MAPIValue raw data.

Returns: the MAPIValue raw data

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

getType

public int getType()
Gets the MAPIValue type.

Returns: the MAPIValue type

getValue

public Object getValue()
Returns the value encapsulated by this MAPIValue. The returned Object should be cast into an appropriate class, according to the MAPIValue's type.

Returns: the value encapsulated by this MAPIValue

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

toString

public String toString()
Returns a string representation of this object.

Returns: a string representation of this object