Package nux.xom.binary

Examples of nux.xom.binary.BinaryXMLCodec.serialize()


     
      Document doc = new Builder().build(file);
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      for (int p=0; p < iterations; p++) {
        System.out.println("compressionLevel=" + compressionLevel);
        codec.serialize(doc, compressionLevel, out);
        if (testCompressionLevels) { // alternate on each iteration
          compressionLevel = (compressionLevel + 1) % 10;
        }
      }
     
View Full Code Here


              baseURI = "file:/" + baseURI;
            }
  //          System.out.println("baseURI: " + baseURI);
            Document doc = new Builder().build(file);
           
            byte[] data = codec.serialize(doc, compressionLevel);
            if (!cmd.equals("test")) doc = new BinaryXMLCodec().deserialize(data); // use "interned" strings
            byte[] fileData = FileUtil.toByteArray(new FileInputStream(file));
            long fileLength = file.length();
            int encodedSize = 0;
           
View Full Code Here

                // serialize
                if (cmd.equals("ser") || cmd.equals("serdeser") || cmd.equals("test")) {
                  ByteArrayOutputStream out = createOutputStream(cmd.equals("ser"));
                  if (mode.startsWith("bnux")) {
                    if (mode.indexOf("stream") < 0) {
                      codec.serialize(doc, compressionLevel, out);
                      data = out.toByteArray();
                    } else {
                      data = serializeWithStreamingBnux(doc, compressionLevel, out);
                    }
                  } else if (mode.startsWith("xom")) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.