IT. Expert System.

Android Reference

CoderResult


java.nio.charset

Class CoderResult



  • public class CoderResult
    extends Object
    Used to indicate the result of encoding/decoding. There are four types of results:
    1. UNDERFLOW indicates that all input has been processed but more input is required. It is represented by the unique object CoderResult.UNDERFLOW.
    2. OVERFLOW indicates an insufficient output buffer size. It is represented by the unique object CoderResult.OVERFLOW.
    3. A malformed-input error indicates that an unrecognizable sequence of input units has been encountered. Get an instance of this type of result by calling CoderResult.malformedForLength(int) with the length of the malformed-input.
    4. An unmappable-character error indicates that a sequence of input units can not be mapped to the output charset. Get an instance of this type of result by calling CoderResult.unmappableForLength(int) with the input sequence size indicating the identity of the unmappable character.
    • Field Summary

      Fields
      Modifier and Type Field and Description
      static CoderResult OVERFLOW
      Result object used to indicate that the output buffer does not have enough space available to store the result of the encoding/decoding.
      static CoderResult UNDERFLOW
      Result object indicating that there is insufficient data in the encoding/decoding buffer or that additional data is required.
    • Field Detail

      • UNDERFLOW

        public static final CoderResult UNDERFLOW
        Result object indicating that there is insufficient data in the encoding/decoding buffer or that additional data is required.
      • OVERFLOW

        public static final CoderResult OVERFLOW
        Result object used to indicate that the output buffer does not have enough space available to store the result of the encoding/decoding.
    • Method Detail

      • malformedForLength

        public static CoderResult malformedForLength(int length)
                                              throws IllegalArgumentException
        Gets a CoderResult object indicating a malformed-input error.
        Parameters:
        length - the length of the malformed-input.
        Returns:
        a CoderResult object indicating a malformed-input error.
        Throws:
        IllegalArgumentException - if length is non-positive.
      • unmappableForLength

        public static CoderResult unmappableForLength(int length)
                                               throws IllegalArgumentException
        Gets a CoderResult object indicating an unmappable character error.
        Parameters:
        length - the length of the input unit sequence denoting the unmappable character.
        Returns:
        a CoderResult object indicating an unmappable character error.
        Throws:
        IllegalArgumentException - if length is non-positive.
      • isUnderflow

        public boolean isUnderflow()
        Returns true if this result is an underflow condition.
        Returns:
        true if an underflow, otherwise false.
      • isError

        public boolean isError()
        Returns true if this result represents a malformed-input error or an unmappable-character error.
        Returns:
        true if this is a malformed-input error or an unmappable-character error, otherwise false.
      • isMalformed

        public boolean isMalformed()
        Returns true if this result represents a malformed-input error.
        Returns:
        true if this is a malformed-input error, otherwise false.
      • isOverflow

        public boolean isOverflow()
        Returns true if this result is an overflow condition.
        Returns:
        true if this is an overflow, otherwise false.
      • isUnmappable

        public boolean isUnmappable()
        Returns true if this result represents an unmappable-character error.
        Returns:
        true if this is an unmappable-character error, otherwise false.
      • length

        public int length()
                   throws UnsupportedOperationException
        Gets the length of the erroneous input. The length is only meaningful to a malformed-input error or an unmappable character error.
        Returns:
        the length, as an integer, of this object's erroneous input.
        Throws:
        UnsupportedOperationException - if this result is an overflow or underflow.
      • toString

        public String toString()
        Returns a text description of this result.
        Overrides:
        toString in class Object
        Returns:
        a text description of this result.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 454 / 158666208. Delta: 0.04842 с