question: private static boolean inEncoding ( char ch , String encoding ) { boolean isInEncoding ; try { char cArray [ ] = new char [ 1 ] ; cArray [ 0 ] = ch ; String s = new String ( cArray ) ; byte [ ] bArray = s . getBytes ( encoding ) ; isInEncoding = inEncoding ( ch , bArray ) ; } catch ( Exception e ) { isInEncoding = false ; if ( encoding == null ) isInEncoding = true ; } return isInEncoding ; }
target:  This is heart of the code that determines if a given character is in the given encoding. This method is probably expensive, and the answer should be cached. <p> This method is not a public API, and should only be used internally within the serializer.