Package aterm.pure.binary

Examples of aterm.pure.binary.BinaryReader


  public void read(byte[] input, ATerm expectedResult){
    ByteBuffer buffer = ByteBuffer.allocate(input.length);
    buffer.put(input);
    buffer.flip();
   
    BinaryReader binaryReader = new BinaryReader(pureFactory);
    binaryReader.deserialize(buffer);
    ATerm result = binaryReader.getRoot();
   
    if(result != expectedResult){
      log("The result didn't match the expected result.");
      /*log("Was: "+result+", expected: "+expectedResult);*/
      return;
 
View Full Code Here


 
  public void testChunkification() throws VisitFailure{
    ATerm in = makeBigDummyTerm(2500);
    ByteBuffer buffer = ByteBuffer.allocate(1000);
    BinaryWriter bw = new BinaryWriter(in);
    BinaryReader binaryReader = new BinaryReader(pureFactory);
   
    while(!binaryReader.isDone()){
      buffer.clear();
      bw.serialize(buffer);
      binaryReader.deserialize(buffer);
    }
   
    ATerm result = binaryReader.getRoot();
   
    if(result == in) log("Chunkification OK");
    else log("Chunkification FAILED");
  }
View Full Code Here

TOP

Related Classes of aterm.pure.binary.BinaryReader

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.