Beispiel #1
0
  public void writeInt(int val) throws IOException {
    if (val > 0) {
      int b = SINT | (val & 0x0f);

      if (val >= 0x0f) {
        b |= 0x10;
        daos.writeByte(b);
        writeVInt(val >>> 4, daos);
      } else {
        daos.writeByte(b);
      }

    } else {
      daos.writeByte(INT);
      daos.writeInt(val);
    }
  }
 @Override
 public void writeFloat(float v) throws IOException {
   writeInt(Float.floatToRawIntBits(v));
 }
Beispiel #3
0
 protected void endRecord(long startRecordPosition) throws IOException {
   fos.writeInt((int) (fos.size() - startRecordPosition));
   numRecords++;
 }