Package mina

Examples of mina.MinaStructPacker


  public static void testPerf2(Object o, int iters) {
    try {
      TimeTracker.startClock("s");
      byte[] b = null;
     
      MinaStructPacker out = new MinaStructPacker();
      for (int i = 0; i < iters; i++) {
        b = out.pack(o);
        out.reset();
      }
      System.out.println("(" + o.getClass().getName()
          + ") Packing performance:  "
          + TimeTracker.getItemCountPerSecond("s", iters));
      System.out.println("Size: " + b.length);
View Full Code Here


  public void testPublicPrimitives() {
    PublicPrimitives pp = new PublicPrimitives();
    pp.setParams();
    try {
      MinaStructPacker so = new MinaStructPacker();
      byte[] b = so.pack(pp);
      PublicPrimitives pp2 = new PublicPrimitives();
      assertFalse(pp.equals(pp2));
      JavaStruct.unpack(pp2, b);
      assertTrue(pp.equals(pp2));
    } catch (StructException e) {
View Full Code Here

  public void testPrivatePrimitives() {
    PrivatePrimitives pp = new PrivatePrimitives();
    pp.setParams();
    try {
      MinaStructPacker so = new MinaStructPacker();
      byte[] b = so.pack(pp)
      PrivatePrimitives pp2 = new PrivatePrimitives();
      assertFalse(pp.equals(pp2));
      JavaStruct.unpack(pp2, b);
      assertTrue(pp.equals(pp2));
    } catch (StructException e) {
View Full Code Here

TOP

Related Classes of mina.MinaStructPacker

Copyright © 2018 www.massapicom. 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.