Save This Page
Home » openjdk-7 » java » nio » charset » [javadoc | source]
java.nio.charset
public class: CoderResult [javadoc | source]
java.lang.Object
   java.nio.charset.CoderResult
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.

Field Summary
public static final  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.

 
public static final  CoderResult OVERFLOW    Result object indicating overflow, meaning that there is insufficient room in the output buffer.

 
Method from java.nio.charset.CoderResult Summary:
isError,   isMalformed,   isOverflow,   isUnderflow,   isUnmappable,   length,   malformedForLength,   throwException,   toString,   unmappableForLength
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.nio.charset.CoderResult Detail:
 public boolean isError() 
    Tells whether or not this object describes an error condition.

 public boolean isMalformed() 
    Tells whether or not this object describes a malformed-input error.

 public boolean isOverflow() 
    Tells whether or not this object describes an overflow condition.

 public boolean isUnderflow() 
    Tells whether or not this object describes an underflow condition.

 public boolean isUnmappable() 
    Tells whether or not this object describes an unmappable-character error.

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

 public static CoderResult malformedForLength(int length) 
    Static factory method that returns the unique object describing a malformed-input error of the given length.

 public  void throwException() throws CharacterCodingException 
    Throws an exception appropriate to the result described by this object.

 public String toString() 
    Returns a string describing this coder result.
 public static CoderResult unmappableForLength(int length) 
    Static factory method that returns the unique result object describing an unmappable-character error of the given length.