public int parse(char c,CharBuffer in){
  if (Surrogate.isHigh(c)) {
    if (!in.hasRemaining()) {
      error=CoderResult.UNDERFLOW;
      return -1;
    }
    char d=in.get();
    if (Surrogate.isLow(d)) {
      character=toUCS4(c,d);
      isPair=true;
      error=null;
      return character;
    }
    error=CoderResult.malformedForLength(1);
    return -1;
  }
  if (Surrogate.isLow(c)) {
    error=CoderResult.malformedForLength(1);
    return -1;
  }
  character=c;
  isPair=false;
  error=null;
  return character;
}

public int parse ( char c , CharBuffer in ) { if ( Surrogate . isHigh ( c ) ) { if ( ! in . hasRemaining ( ) ) { error = CoderResult . UNDERFLOW ; return - 1 ; } char d = in . get ( ) ; if ( Surrogate . isLow ( d ) ) { character = toUCS4 ( c , d ) ; isPair = true ; error = null ; return character ; } error = CoderResult . malformedForLength ( 1 ) ; return - 1 ; } if ( Surrogate . isLow ( c ) ) { error = CoderResult . malformedForLength ( 1 ) ; return - 1 ; } character = c ; isPair = false ; error = null ; return character ; }
parses a ucs - 4 character from the given source buffer , handling surrogates .
