コード例 #1
0
ファイル: InputOutputTest.java プロジェクト: esialb/kryo
  private void runShortTest(Output write) throws IOException {
    write.writeShort(0);
    write.writeShort(63);
    write.writeShort(64);
    write.writeShort(127);
    write.writeShort(128);
    write.writeShort(8192);
    write.writeShort(16384);
    write.writeShort(32767);
    write.writeShort(-63);
    write.writeShort(-64);
    write.writeShort(-127);
    write.writeShort(-128);
    write.writeShort(-8192);
    write.writeShort(-16384);
    write.writeShort(-32768);

    Input read = new Input(write.toBytes());
    assertEquals(0, read.readShort());
    assertEquals(63, read.readShort());
    assertEquals(64, read.readShort());
    assertEquals(127, read.readShort());
    assertEquals(128, read.readShort());
    assertEquals(8192, read.readShort());
    assertEquals(16384, read.readShort());
    assertEquals(32767, read.readShort());
    assertEquals(-63, read.readShort());
    assertEquals(-64, read.readShort());
    assertEquals(-127, read.readShort());
    assertEquals(-128, read.readShort());
    assertEquals(-8192, read.readShort());
    assertEquals(-16384, read.readShort());
    assertEquals(-32768, read.readShort());
  }
コード例 #2
0
ファイル: HelloMessage.java プロジェクト: kisorbiswal/ecgine
 @Override
 public void write(Kryo kryo, Output output) {
   super.write(kryo, output);
   output.writeShort(orgId);
   output.writeLong(deviceId);
 }
コード例 #3
0
 public void write(Kryo kryo, Output output, Short object) {
   output.writeShort(object);
 }