コード例 #1
0
ファイル: InputOutputTest.java プロジェクト: esialb/kryo
  private void runBooleanTest(Output write) throws IOException {
    for (int i = 0; i < 100; i++) {
      write.writeBoolean(true);
      write.writeBoolean(false);
    }

    Input read = new Input(write.toBytes());
    for (int i = 0; i < 100; i++) {
      assertEquals(true, read.readBoolean());
      assertEquals(false, read.readBoolean());
    }
  }
コード例 #2
0
 public void write(Kryo kryo, Output output, Calendar object) {
   timeZoneSerializer.write(kryo, output, object.getTimeZone()); // can't be null
   output.writeLong(object.getTimeInMillis(), true);
   output.writeBoolean(object.isLenient());
   output.writeInt(object.getFirstDayOfWeek(), true);
   output.writeInt(object.getMinimalDaysInFirstWeek(), true);
   if (object instanceof GregorianCalendar)
     output.writeLong(((GregorianCalendar) object).getGregorianChange().getTime(), false);
   else output.writeLong(DEFAULT_GREGORIAN_CUTOVER, false);
 }
コード例 #3
0
    public void onOutput(long classId, long testId, TestOutputEvent outputEvent) {
      boolean stdout = outputEvent.getDestination() == TestOutputEvent.Destination.StdOut;
      mark(classId, testId, stdout);

      output.writeBoolean(stdout);
      output.writeLong(classId);
      output.writeLong(testId);

      byte[] bytes;
      try {
        bytes = outputEvent.getMessage().getBytes(messageStorageCharset.name());
      } catch (UnsupportedEncodingException e) {
        throw UncheckedException.throwAsUncheckedException(e);
      }
      output.writeInt(bytes.length);
      output.writeBytes(bytes);
    }
コード例 #4
0
 public void writeBoolean(boolean value) throws IOException {
   output.writeBoolean(value);
 }
コード例 #5
0
 public void write(Kryo kryo, Output output, Boolean object) {
   output.writeBoolean(object);
 }