|
Cryptix OpenPGP | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcryptix.message.Message
cryptix.message.LiteralMessage
Message containing encoded 'literal data'.
This method can transparantly handle both binary and text data, the difference between the two being that text data is usually encoded in a format specific way. E.g. for OpenPGP this is UTF-8.
Field Summary | |
static int |
BINARY
Returned by getDataType() when the contained data is in binary format. |
static int |
TEXT
Returned by getDataType() when the contained data is in text format. |
static int |
UNKNOWN
Returned by getDataType() when it is unknown if the contained data is in text or binary format. |
Constructor Summary | |
LiteralMessage(java.lang.String format)
Creates a LiteralMessage of the specified format. |
Method Summary | |
abstract byte[] |
getBinaryData()
Returns the data in binary format as an array of bytes. |
abstract java.io.InputStream |
getBinaryDataInputStream()
Returns the data in binary format trough an inputstream. |
abstract int |
getDataType()
Returns the type of data contained within this message. |
abstract java.lang.String |
getTextData()
Returns the data in text format as a string. |
abstract java.io.Reader |
getTextDataReader()
Returns the data in text format as a character reader. |
Methods inherited from class cryptix.message.Message |
equals, getAttribute, getEncoded, getFormat, hashCode |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNKNOWN
This usually happens because the underlying format does not store this information. When this happens, support for retrieving the data in binary format must be supported by the implementing class, while support for retrieving data in text format is optional.
public static final int BINARY
public static final int TEXT
Constructor Detail |
public LiteralMessage(java.lang.String format)
Method Detail |
public abstract int getDataType()
Can be one of UNKNOWN, BINARY and TEXT.
If the returned type is UNKNOWN, then usually the underlying format does not store this information. When this happens, support for retrieving the data in binary format must be supported by the implementing class, while support for retrieving data in text format is optional.
public abstract byte[] getBinaryData() throws java.lang.UnsupportedOperationException, MessageException
MUST be supported when getDataType() returns BINARY or UNKNOWN.
MAY be supported when getDataType() returns TEXT.
java.lang.UnsupportedOperationException
- when this particular operation is
not supported. See above for restrictions on when an implementing
class is allowed to throw this exception.
MessageException
- on a variety of format specific problems.public abstract java.io.InputStream getBinaryDataInputStream() throws java.lang.UnsupportedOperationException, MessageException
MUST be supported when getDataType() returns BINARY or UNKNOWN.
MAY be supported when getDataType() returns TEXT.
java.lang.UnsupportedOperationException
- when this particular operation is
not supported. See above for restrictions on when an implementing
class is allowed to throw this exception.
MessageException
- on a variety of format specific problems.public abstract java.lang.String getTextData() throws java.lang.UnsupportedOperationException, MessageException
MUST be supported when getDataType() returns TEXT.
MAY be supported when getDataType() returns BINARY or UNKNOWN.
java.lang.UnsupportedOperationException
- when this particular operation is
not supported. See above for restrictions on when an implementing
class is allowed to throw this exception.
MessageException
- on a variety of format specific problems.public abstract java.io.Reader getTextDataReader() throws java.lang.UnsupportedOperationException, MessageException
MUST be supported when getDataType() returns TEXT.
MAY be supported when getDataType() returns BINARY or UNKNOWN.
java.lang.UnsupportedOperationException
- when this particular operation is
not supported. See above for restrictions on when an implementing
class is allowed to throw this exception.
MessageException
- on a variety of format specific problems.
|
Cryptix OpenPGP | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |