java::io::CoderResult Class Reference

Inheritance diagram for java::io::CoderResult:

Inheritance graph
java::lang::Object
[legend]
Collaboration diagram for java::io::CoderResult:

Collaboration graph
java::lang::Object
[legend]

List of all members.


Detailed Description

A description of the result state of a coder.

A charset coder, that is, either a decoder or an encoder, consumes bytes (or characters) from an input buffer, translates them, and writes the resulting characters (or bytes) to an output buffer. A coding process terminates for one of four categories of reasons, which are described by instances of this class:

For convenience, the isError method returns true for result objects that describe malformed-input and unmappable-character errors but false for those that describe underflow or overflow conditions.

Author:
Mark Reinhold

JSR-51 Expert Group

Version:
1.7, 03/01/23
Since:
1.4

Public Member Functions

 CoderResult ()
virtual String toString () const
 Returns a string describing this coder result.
jboolean isUnderflow () const
 Tells whether or not this object describes an underflow condition.
jboolean isOverflow () const
 Tells whether or not this object describes an overflow condition.
jboolean isError () const
 Tells whether or not this object describes an error condition.
jboolean isMalformed () const
 Tells whether or not this object describes a malformed-input error.
jboolean isUnmappable () const
 Tells whether or not this object describes an unmappable-character error.
jint length () const
 Returns the length of the erroneous input described by this object  (optional operation).
void throwException ()
 Throws an exception appropriate to the result described by this object.

Static Public Member Functions

static Ref< CoderResultmalformedForLength (jint len)
 Static factory method that returns the unique object describing a malformed-input error of the given length.
static Ref< CoderResultunmappableForLength (jint len)
 Static factory method that returns the unique result object describing an unmappable-character error of the given length.

Static Public Attributes

static CoderResult UNDERFLOW
 Result object indicating underflow, meaning that either the input buffer has been completely consumed or, if the input buffer is not yet empty, that additional input is required.
static CoderResult OVERFLOW
 Result object indicating overflow, meaning that there is insufficient room in the output buffer.

Constructor & Destructor Documentation

java::io::CoderResult::CoderResult (  ) 


Member Function Documentation

virtual String java::io::CoderResult::toString (  )  const [virtual]

Returns a string describing this coder result.

Returns:
A descriptive string

Reimplemented from java::lang::Object.

jboolean java::io::CoderResult::isUnderflow (  )  const

Tells whether or not this object describes an underflow condition.

Returns:
true if, and only if, this object denotes underflow

jboolean java::io::CoderResult::isOverflow (  )  const

Tells whether or not this object describes an overflow condition.

Returns:
true if, and only if, this object denotes overflow

jboolean java::io::CoderResult::isError (  )  const

Tells whether or not this object describes an error condition.

Returns:
true if, and only if, this object denotes either a malformed-input error or an unmappable-character error

jboolean java::io::CoderResult::isMalformed (  )  const

Tells whether or not this object describes a malformed-input error.

Returns:
true if, and only if, this object denotes a malformed-input error

jboolean java::io::CoderResult::isUnmappable (  )  const

Tells whether or not this object describes an unmappable-character error.

Returns:
true if, and only if, this object denotes an unmappable-character error

jint java::io::CoderResult::length (  )  const

Returns the length of the erroneous input described by this object  (optional operation).

Returns:
The length of the erroneous input, a positive integer
Exceptions:
UnsupportedOperationException If this object does not describe an error condition, that is, if the isError does not return true

static Ref<CoderResult> java::io::CoderResult::malformedForLength ( jint  len  )  [static]

Static factory method that returns the unique object describing a malformed-input error of the given length.

Returns:
The requested coder-result object

static Ref<CoderResult> java::io::CoderResult::unmappableForLength ( jint  len  )  [static]

Static factory method that returns the unique result object describing an unmappable-character error of the given length.

Returns:
The requested coder-result object

void java::io::CoderResult::throwException (  ) 

Throws an exception appropriate to the result described by this object.

Exceptions:
BufferUnderflowException If this object is UNDERFLOW
BufferOverflowException If this object is OVERFLOW
MalformedInputException If this object represents a malformed-input error; the exception's length value will be that of this object
UnmappableCharacterException If this object represents an unmappable-character error; the exceptions length value will be that of this object


Member Data Documentation

CoderResult java::io::CoderResult::UNDERFLOW [static]

Result object indicating underflow, meaning that either the input buffer has been completely consumed or, if the input buffer is not yet empty, that additional input is required.

CoderResult java::io::CoderResult::OVERFLOW [static]

Result object indicating overflow, meaning that there is insufficient room in the output buffer.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:29 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3