Package com.esotericsoftware.kryo.io

Examples of com.esotericsoftware.kryo.io.ByteBufferInputStream


    Output testOutput = new Output(byteBufferOutputStream);
    testOutput.writeBytes(new byte[512]);
    testOutput.writeBytes(new byte[512]);
    testOutput.flush();

    ByteBufferInputStream testInputs = new ByteBufferInputStream();
    buf.flip();
    testInputs.setByteBuffer(buf);
    Input input = new Input(testInputs, 512);
    byte[] toRead = new byte[512];
    input.readBytes(toRead);

    input.readBytes(toRead);   
View Full Code Here


    long latestTimestamp = b.getLong(MonitoringDataStorage.LATEST_POSITION);
    assertEquals(42, earliestTimestamp);
    assertEquals(43, latestTimestamp);
   
    Kryo kryo = new Kryo();
    Input input = new Input(new ByteBufferInputStream(b));
    input.setPosition(MonitoringDataStorage.FIRST_RECORD_POSITION);
    assertEquals("blabla1",((MonitoringDataDummy)kryo.readClassAndObject(input)).value);
    assertEquals("blabla2",((MonitoringDataDummy)kryo.readClassAndObject(input)).value);
    assertNull(kryo.readClassAndObject(input));
    b.putInt(MonitoringDataStorage.LIMIT_POSITION, b.position());
View Full Code Here

      Kryo kryo = getCurrentThreadKryo();
     
      // skip the buffer length parameter
      buffer.position(buffer.position() + 4);
     
      Input in = new Input(new ByteBufferInputStream(buffer));
      Message msg = (Message) kryo.readClassAndObject(in);
      in.close();
      msg.rewind();
      return msg;
   }
View Full Code Here

    Output testOutput = new Output(byteBufferOutputStream);
    testOutput.writeBytes(new byte[512]);
    testOutput.writeBytes(new byte[512]);
    testOutput.flush();

    ByteBufferInputStream testInputs = new ByteBufferInputStream();
    buf.flip();
    testInputs.setByteBuffer(buf);
    Input input = new Input(testInputs, 512);
    byte[] toRead = new byte[512];
    input.readBytes(toRead);

    input.readBytes(toRead);
View Full Code Here

TOP

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

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.