@Override public void writeDouble(double d, String tag) throws IOException { printCommaUnlessFirst(); stream.print(d); throwExceptionOnError(tag); }
@Override public void writeFloat(float f, String tag) throws IOException { writeDouble((double)f, tag); }
@Override public void writeInt(int i, String tag) throws IOException { writeLong((long)i, tag); }
@Override public void startVector(ArrayList v, String tag) throws IOException { printCommaUnlessFirst(); stream.print("v{"); isFirst = true; }
@Override public String toString() { try { ByteArrayOutputStream s = new ByteArrayOutputStream(); CsvRecordOutput a = new CsvRecordOutput(s); this.serialize(a); return new String(s.toByteArray(), "UTF-8"); } catch (Throwable ex) { throw new RuntimeException(ex); } } }
private void write(CharSequence label, Record record, BufferedWriter writer) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream() ; CsvRecordOutput cro = new CsvRecordOutput(outStream) ; cro.writeString(label.toString(), "labelText"); record.serialize(cro) ; writer.write(outStream.toString("UTF-8")) ; }
private void write(Integer id, Record record, BufferedWriter writer) throws IOException { ByteArrayOutputStream outStream = new ByteArrayOutputStream() ; CsvRecordOutput cro = new CsvRecordOutput(outStream) ; cro.writeInt(id, "pageId") ; record.serialize(cro) ; writer.write(outStream.toString("UTF-8")) ; }
@Override public void startVector(ArrayList v, String tag) throws IOException { printCommaUnlessFirst(); stream.print("v{"); isFirst = true; }
@Override public String toString() { try { ByteArrayOutputStream s = new ByteArrayOutputStream(); CsvRecordOutput a = new CsvRecordOutput(s); this.serialize(a); return new String(s.toByteArray(), "UTF-8"); } catch (Throwable ex) { throw new RuntimeException(ex); } } }
CsvRecordOutput cro = new CsvRecordOutput(outStream) ; cro.writeString(e.getKey(), null) ; e.getValue().serialize(cro) ;
@Override public void writeLong(long l, String tag) throws IOException { printCommaUnlessFirst(); stream.print(l); throwExceptionOnError(tag); }
@Override public void startMap(TreeMap v, String tag) throws IOException { printCommaUnlessFirst(); stream.print("m{"); isFirst = true; }
@Override public String toString() { try { ByteArrayOutputStream s = new ByteArrayOutputStream(); CsvRecordOutput a = new CsvRecordOutput(s); this.serialize(a); return new String(s.toByteArray(), "UTF-8"); } catch (Throwable ex) { throw new RuntimeException(ex); } } }
@Override public void writeByte(byte b, String tag) throws IOException { writeLong((long)b, tag); }
@Override public void writeFloat(float f, String tag) throws IOException { writeDouble((double)f, tag); }
public void writeDouble(double d, String tag) throws IOException { printCommaUnlessFirst(); stream.print(d); throwExceptionOnError(tag); }
@Override public void startMap(TreeMap v, String tag) throws IOException { printCommaUnlessFirst(); stream.print("m{"); isFirst = true; }
@Override public String toString() { try { ByteArrayOutputStream s = new ByteArrayOutputStream(); CsvRecordOutput a = new CsvRecordOutput(s); this.serialize(a); return new String(s.toByteArray(), "UTF-8"); } catch (Throwable ex) { throw new RuntimeException(ex); } } }
@Override public void writeByte(byte b, String tag) throws IOException { writeLong((long)b, tag); }
@Override public void writeFloat(float f, String tag) throws IOException { writeDouble((double)f, tag); }