Package com.esotericsoftware.kryo.io

Examples of com.esotericsoftware.kryo.io.Output.writeBytes()


/** @author Nathan Sweet <misc@n4te.com> */
public class InputOutputTest extends KryoTestCase {
  public void testOutputStream () throws IOException {
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    Output output = new Output(buffer, 2);
    output.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
    output.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
    output.writeBytes(new byte[] {51, 52, 53, 54, 55, 56, 57, 58});
    output.writeBytes(new byte[] {61, 62, 63, 64, 65});
    output.flush();

View Full Code Here


public class InputOutputTest extends KryoTestCase {
  public void testOutputStream () throws IOException {
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    Output output = new Output(buffer, 2);
    output.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
    output.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
    output.writeBytes(new byte[] {51, 52, 53, 54, 55, 56, 57, 58});
    output.writeBytes(new byte[] {61, 62, 63, 64, 65});
    output.flush();

    assertEquals(new byte[] { //
View Full Code Here

  public void testOutputStream () throws IOException {
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    Output output = new Output(buffer, 2);
    output.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
    output.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
    output.writeBytes(new byte[] {51, 52, 53, 54, 55, 56, 57, 58});
    output.writeBytes(new byte[] {61, 62, 63, 64, 65});
    output.flush();

    assertEquals(new byte[] { //
      11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, //
View Full Code Here

    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    Output output = new Output(buffer, 2);
    output.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
    output.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
    output.writeBytes(new byte[] {51, 52, 53, 54, 55, 56, 57, 58});
    output.writeBytes(new byte[] {61, 62, 63, 64, 65});
    output.flush();

    assertEquals(new byte[] { //
      11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, //
        31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, //
View Full Code Here

    assertEquals(bytes, temp2);
  }

  public void testWriteBytes () throws IOException {
    Output buffer = new Output(512);
    buffer.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
    buffer.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
    buffer.writeByte(51);
    buffer.writeBytes(new byte[] {52, 53, 54, 55, 56, 57, 58});
    buffer.writeByte(61);
    buffer.writeByte(62);
View Full Code Here

  }

  public void testWriteBytes () throws IOException {
    Output buffer = new Output(512);
    buffer.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
    buffer.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
    buffer.writeByte(51);
    buffer.writeBytes(new byte[] {52, 53, 54, 55, 56, 57, 58});
    buffer.writeByte(61);
    buffer.writeByte(62);
    buffer.writeByte(63);
View Full Code Here

  public void testWriteBytes () throws IOException {
    Output buffer = new Output(512);
    buffer.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
    buffer.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
    buffer.writeByte(51);
    buffer.writeBytes(new byte[] {52, 53, 54, 55, 56, 57, 58});
    buffer.writeByte(61);
    buffer.writeByte(62);
    buffer.writeByte(63);
    buffer.writeByte(64);
    buffer.writeByte(65);
View Full Code Here

 
  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();

    ByteBufferInputStream testInputs = new ByteBufferInputStream();
    buf.flip();
View Full Code Here

  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();

    ByteBufferInputStream testInputs = new ByteBufferInputStream();
    buf.flip();
    testInputs.setByteBuffer(buf);
View Full Code Here

/** @author Nathan Sweet <misc@n4te.com> */
public class InputOutputTest extends KryoTestCase {
  public void testOutputStream () throws IOException {
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    Output output = new Output(buffer, 2);
    output.writeBytes(new byte[] {11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26});
    output.writeBytes(new byte[] {31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46});
    output.writeBytes(new byte[] {51, 52, 53, 54, 55, 56, 57, 58});
    output.writeBytes(new byte[] {61, 62, 63, 64, 65});
    output.flush();

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.