public void promptValue(byte[] bs, boolean bigEndian, SpecificCharacterSet cs, char[] cbuf, int maxLen, final StringBuffer out) { toChars(bs, bigEndian, cs, cbuf, maxLen, new CharOut() { public void write(char[] ch, int start, int length) { out.append(ch, start, length); } }); }
public void formatXMLValue(byte[] bs, boolean bigEndian, SpecificCharacterSet cs, char[] cbuf, final ContentHandler out) throws SAXException { try { toChars(bs, bigEndian, cs, cbuf, -1, new CharOut() { public void write(char[] ch, int start, int length) { try { out.characters(ch, start, length); } catch (SAXException e) { throw new RuntimeException(e); } } }); } catch (RuntimeException e) { if (e.getCause() instanceof SAXException) throw (SAXException) e.getCause(); throw e; } }