@Override public void writeI16(short i16) throws TException { writeJSONInteger((long)i16); }
@Override public void writeI64(long i64) throws TException { writeJSONInteger(i64); }
@Override public void writeI32(int i32) throws TException { writeJSONInteger((long)i32); }
@Override public void writeBool(boolean b) throws TException { writeJSONInteger(b ? (long)1 : (long)0); }
@Override public void writeByte(byte b) throws TException { writeJSONInteger((long)b); }
@Override public void writeMessageBegin(TMessage message) throws TException { resetContext(); // THRIFT-3743 writeJSONArrayStart(); writeJSONInteger(VERSION); try { byte[] b = message.name.getBytes("UTF-8"); writeJSONString(b); } catch (UnsupportedEncodingException uex) { throw new TException("JVM DOES NOT SUPPORT UTF-8"); } writeJSONInteger(message.type); writeJSONInteger(message.seqid); }
@Override public void writeSetBegin(TSet set) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(set.elemType)); writeJSONInteger(set.size); }
@Override public void writeListBegin(TList list) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(list.elemType)); writeJSONInteger(list.size); }
@Override public void writeFieldBegin(TField field) throws TException { if (fieldNamesAsString_) { writeString(field.name); } else { writeJSONInteger(field.id); } writeJSONObjectStart(); writeJSONString(getTypeNameForTypeID(field.type)); }
@Override public void writeMapBegin(TMap map) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(map.keyType)); writeJSONString(getTypeNameForTypeID(map.valueType)); writeJSONInteger(map.size); writeJSONObjectStart(); }
@Override public void writeI32(int i32) throws TException { writeJSONInteger((long)i32); }
@Override public void writeI64(long i64) throws TException { writeJSONInteger(i64); }
@Override public void writeFieldBegin(TField field) throws TException { writeJSONInteger(field.id); writeJSONObjectStart(); writeJSONString(getTypeNameForTypeID(field.type)); }
@Override public void writeFieldBegin(TField field) throws TException { writeJSONInteger(field.id); writeJSONObjectStart(); writeJSONString(getTypeNameForTypeID(field.type)); }
@Override public void writeListBegin(TList list) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(list.elemType)); writeJSONInteger(list.size); }
@Override public void writeSetBegin(TSet set) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(set.elemType)); writeJSONInteger(set.size); }
@Override public void writeListBegin(TList list) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(list.elemType)); writeJSONInteger(list.size); }
@Override public void writeSetBegin(TSet set) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(set.elemType)); writeJSONInteger(set.size); }
@Override public void writeListBegin(TList list) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(list.elemType)); writeJSONInteger(list.size); }
@Override public void writeMapBegin(TMap map) throws TException { writeJSONArrayStart(); writeJSONString(getTypeNameForTypeID(map.keyType)); writeJSONString(getTypeNameForTypeID(map.valueType)); writeJSONInteger(map.size); writeJSONObjectStart(); }