Package com.esotericsoftware.kryo.io

Examples of com.esotericsoftware.kryo.io.ByteBufferOutputStream


    assertEquals(10, in.available());
  }
 
  public void testSmallBuffers() throws Exception {
    ByteBuffer buf = ByteBuffer.allocate(1024);
    ByteBufferOutputStream byteBufferOutputStream = new ByteBufferOutputStream(buf);
    Output testOutput = new Output(byteBufferOutputStream);
    testOutput.writeBytes(new byte[512]);
    testOutput.writeBytes(new byte[512]);
    testOutput.flush();
View Full Code Here


      earliest = Math.min(d.getTimeStamp().getTime(), earliest);
      latest = Math.max(d.getTimeStamp().getTime(), latest);
    }
    Kryo kryo = SerializeUtil.createKryo();
    b.position(MonitoringDataStorage.FIRST_RECORD_POSITION);
    Output output = new Output(new ByteBufferOutputStream(b));
    for (MonitoringData data : values) {
      kryo.writeClassAndObject(output, data);
    }
    output.close();
    int limit = b.position();
View Full Code Here

        limit = FIRST_RECORD_POSITION;
        out.putLong(LIMIT_POSITION,limit);
        out.putLong(EARLIEST_POSITION,earliestTimestamp);
        out.putLong(LATEST_POSITION,latestTimestamp);
        out.position(FIRST_RECORD_POSITION);
          bostr = new ByteBufferOutputStream(out);
          output = new Output(bostr);
      } else {
        memoryMappedFile = new RandomAccessFile(file,"r");
        fileSize = (int)file.length();
        MappedByteBuffer bb = memoryMappedFile.getChannel().map(MapMode.READ_ONLY, 0, HEADER_END);
View Full Code Here

      OpenedFile of = new OpenedFile(this, Long.MIN_VALUE, Long.MAX_VALUE, false);
      memoryMappedFile = new RandomAccessFile(file, "rw");
      out = memoryMappedFile.getChannel().map(MapMode.READ_WRITE, 0, FILE_CHUNK_SIZE);
      out.position(limit);
      out.putInt(LIMIT_POSITION,FIRST_RECORD_POSITION);
        bostr = new ByteBufferOutputStream(out);
        output = new Output(bostr);
      kryo = SerializeUtil.createKryo();
     
      MonitoringData md = null;
      Output o = new Output(nullOut);
View Full Code Here

    assertEquals(10, in.available());
  }

  public void testSmallBuffers () throws Exception {
    ByteBuffer buf = ByteBuffer.allocate(1024);
    ByteBufferOutputStream byteBufferOutputStream = new ByteBufferOutputStream(buf);
    Output testOutput = new Output(byteBufferOutputStream);
    testOutput.writeBytes(new byte[512]);
    testOutput.writeBytes(new byte[512]);
    testOutput.flush();
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryo.io.ByteBufferOutputStream

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.