Package com.bubble.serializer

Examples of com.bubble.serializer.SerializationContext.serialize()


  public void testBubbleSpeedSingle()  {
    Pojo pojo = new Pojo(TEST_VALUE);
    SerializationContext context = new SerializationContext();
    ByteBuffer buffer = ByteBuffer.allocate(1024);
    long startTime = System.currentTimeMillis();
    context.serialize(pojo, buffer);
    long endTime = System.currentTimeMillis();
    long delay = endTime-startTime;
    System.out.println("Bubble time: "+delay+"ms");
  }
View Full Code Here


  public void testBubbleSpeedSingle()  {
    Pojo pojo = new Pojo(TEST_VALUE);
    SerializationContext context = new SerializationContext();
    ByteBuffer buffer = ByteBuffer.allocate(1024);
    long startTime = System.currentTimeMillis();
    context.serialize(pojo, buffer);
    long endTime = System.currentTimeMillis();
    long delay = endTime-startTime;
    System.out.println("Bubble time: "+delay+"ms");
  }
View Full Code Here

    long startTime = System.currentTimeMillis();
    for(int j = 0; j < PASSES ; j++) {
      buffer.clear();
      pojos = initPojos();
      for (int i = 0; i < pojos.length; i++) {
        context.serialize(pojos[i], buffer);
      }
    }
    long endTime = System.currentTimeMillis();
    long delay = endTime-startTime;
    System.out.println("Bubble many time: "+delay+"ms");
View Full Code Here

    SerializationContext sc = new SerializationContext();
    ByteBuffer buffer = ByteBuffer.allocateDirect(102400);
    long start = System.currentTimeMillis();
    for (int i = 0; i < loops; i++) {
      testObject = createTestObject();
      sc.serialize(testObject, buffer);
      buffer.flip();
      channel.write(buffer);     
      buffer.clear();
    }
    long total = System.currentTimeMillis()- start;
View Full Code Here

    FileChannel channel = new FileOutputStream(filePrefix).getChannel();     
    SerializationContext sc = new SerializationContext();
    ByteBuffer buffer = ByteBuffer.allocateDirect(102400);
    for (int i = 0; i < loops; i++) {
      testObject = createTestObject();
      sc.serialize(testObject, buffer);
      buffer.flip();
      channel.write(buffer);     
      buffer.clear();
    }
    channel.close();
View Full Code Here

    FileChannel channel = new FileOutputStream(filePrefix).getChannel();     
    SerializationContext sc = new SerializationContext();
    ByteBuffer buffer = ByteBuffer.allocateDirect(102400);
    for (int i = 0; i < loops; i++) {
      testObject = createTestObject();
      sc.serialize(testObject, buffer);
      buffer.flip();
      channel.write(buffer);     
      buffer.clear();
    }
    channel.close();
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.