Record[] records = makeArray(type, numRecords, times); ByteArrayOutputStream bout = new ByteArrayOutputStream(); XmlRecordOutput rout = new XmlRecordOutput(bout);
public void testXml() { File tmpfile; try { tmpfile = new File("/tmp/hadooptemp.xml"); FileOutputStream ostream = new FileOutputStream(tmpfile); XmlRecordOutput out = new XmlRecordOutput(ostream); RecRecord1 r1 = new RecRecord1(); r1.setBoolVal(true); r1.setByteVal((byte)0x66); r1.setFloatVal(3.145F); r1.setDoubleVal(1.5234); r1.setIntVal(4567); r1.setLongVal(0x5a5a5a5a5a5aL); r1.setStringVal("random text"); r1.setBufferVal(new Buffer()); r1.setVectorVal(new ArrayList<String>()); r1.setMapVal(new TreeMap<String,String>()); r1.serialize(out, ""); ostream.close(); } catch (IOException ex) { ex.printStackTrace(); } } }
tmpfile = File.createTempFile("hadooprec", ".xml"); FileOutputStream ostream = new FileOutputStream(tmpfile); XmlRecordOutput out = new XmlRecordOutput(ostream); RecRecord1 r1 = new RecRecord1(); r1.setBoolVal(true);