/** * Output the contents of the memory buffer as a String, using the supplied * encoding * @param enc the encoding to use * @return the contents of the memory buffer as a String */ public String toString(String enc) throws UnsupportedEncodingException { return arr_.toString(enc); }
/** * Output the contents of the memory buffer as a String, using the supplied * encoding * @param enc the encoding to use * @return the contents of the memory buffer as a String */ public String toString(String enc) throws UnsupportedEncodingException { return arr_.toString(enc); }
@Override public String readString() throws TException { try { return readJSONString(false).toString("UTF-8"); } catch (UnsupportedEncodingException ex) { throw new TException("JVM DOES NOT SUPPORT UTF-8"); } }
@Override public String readString() throws TException { try { return readJSONString(false).toString("UTF-8"); } catch (UnsupportedEncodingException ex) { throw new TException("JVM DOES NOT SUPPORT UTF-8"); } }
TByteArrayOutputStream arr = readJSONString(true); try { double dub = Double.valueOf(arr.toString("UTF-8")); if (!context_.escapeNum() && !Double.isNaN(dub) && !Double.isInfinite(dub)) {
TByteArrayOutputStream arr = readJSONString(true); try { double dub = Double.valueOf(arr.toString("UTF-8")); if (!context_.escapeNum() && !Double.isNaN(dub) && !Double.isInfinite(dub)) {
@Override public TMessage readMessageBegin() throws TException { readJSONArrayStart(); if (readJSONInteger() != VERSION) { throw new TProtocolException(TProtocolException.BAD_VERSION, "Message contained bad version."); } String name; try { name = readJSONString(false).toString("UTF-8"); } catch (UnsupportedEncodingException ex) { throw new TException("JVM DOES NOT SUPPORT UTF-8"); } byte type = (byte) readJSONInteger(); int seqid = (int) readJSONInteger(); return new TMessage(name, type, seqid); }
@Override public TMessage readMessageBegin() throws TException { readJSONArrayStart(); if (readJSONInteger() != VERSION) { throw new TProtocolException(TProtocolException.BAD_VERSION, "Message contained bad version."); } String name; try { name = readJSONString(false).toString("UTF-8"); } catch (UnsupportedEncodingException ex) { throw new TException("JVM DOES NOT SUPPORT UTF-8"); } byte type = (byte) readJSONInteger(); int seqid = (int) readJSONInteger(); return new TMessage(name, type, seqid); }