Code example for CharBuffer

Methods: array, arrayOffset, hasArray, limit

0
   *             method will be removed in Lucene 4.0 
   */ 
  @Deprecated 
  public static int getDecodedLength(CharBuffer encoded) 
    throws IllegalArgumentException { 
    if (encoded.hasArray()) {
      return getDecodedLength(encoded.array(), encoded.arrayOffset(), 
          encoded.limit() - encoded.arrayOffset());
    } else { 
      throw new IllegalArgumentException("encoded argument must have a backing array");
    } 
  } 
   
  /** 
   * Returns the number of bytes required to decode the given char sequence. 
   *  
   * @param encoded char sequence to be decoded 
   * @param offset initial offset 
   * @param length number of characters 
   * @return The number of bytes required to decode the given char sequence 
   */