Package com.peterhi.io

Examples of com.peterhi.io.PmOutputStream.writeModel()


    threadPool.submit(new Run<Void>() {
      @Override
      protected void onRun() throws Exception {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PmOutputStream pos = new PmOutputStream(baos);
        pos.writeModel(sink);
        byte[] bytes = baos.toByteArray();
        server.send(address, bytes, 0, bytes.length, reliable);
        pos.close();
      }
    }.asRunnable());
View Full Code Here


 
  private void doWriteModel(SocketAddress address, PropModel model)
    throws Exception {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PmOutputStream pos = new PmOutputStream(baos);
    pos.writeModel(model);
    byte[] buffer = baos.toByteArray();
    server.send(address, buffer, 0, buffer.length, true);
    pos.close();
  }
 
View Full Code Here

    Assert.assertEquals(new uintx(uintx.MAX_62),
      PropUtil.getValue(p0, "uintxValue"));
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PmOutputStream pos = new PmOutputStream(baos);
    pos.writeModel(p0);
   
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    PmInputStream pis = new PmInputStream(bais);
    Primitives p1 = pis.readModel();
   
View Full Code Here

    b0.setFloatObject(Float.MAX_VALUE);
    b0.setDoubleObject(Double.MAX_VALUE);
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PmOutputStream pos = new PmOutputStream(baos);
    pos.writeModel(bNull);
    pos.writeModel(b0);
   
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    PmInputStream pis = new PmInputStream(bais);
    Boxers bNull2 = pis.readModel();
View Full Code Here

    b0.setDoubleObject(Double.MAX_VALUE);
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    PmOutputStream pos = new PmOutputStream(baos);
    pos.writeModel(bNull);
    pos.writeModel(b0);
   
    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    PmInputStream pis = new PmInputStream(bais);
    Boxers bNull2 = pis.readModel();
    Boxers b1 = pis.readModel();
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.