Exemplo n.º 1
0
  /**
   * _more_
   *
   * @param recordIO _more_
   * @throws IOException _more_
   */
  public void write(RecordIO recordIO) throws IOException {
    super.write(recordIO);

    writeByte(recordIO.getDataOutputStream(), b);
    writeShort(recordIO.getDataOutputStream(), s);
    writeInt(recordIO.getDataOutputStream(), i);
    writeLong(recordIO.getDataOutputStream(), l);
    writeDouble(recordIO.getDataOutputStream(), d);
    writeFloat(recordIO.getDataOutputStream(), f);
    writeUnsignedByte(recordIO.getDataOutputStream(), u_b);

    writeUnsignedShort(recordIO.getDataOutputStream(), u_s);

    writeUnsignedInt(recordIO.getDataOutputStream(), u_i);
    write(recordIO.getDataOutputStream(), a_b);
    write(recordIO.getDataOutputStream(), a_s);
    write(recordIO.getDataOutputStream(), a_i);
    write(recordIO.getDataOutputStream(), a_f);
    write(recordIO.getDataOutputStream(), a_d);
    write(recordIO.getDataOutputStream(), a_l);
    writeUnsignedBytes(recordIO.getDataOutputStream(), u_a_b);
    writeUnsignedShorts(recordIO.getDataOutputStream(), u_a_s);
    writeUnsignedInts(recordIO.getDataOutputStream(), u_a_i);
  }
Exemplo n.º 2
0
  /**
   * _more_
   *
   * @param recordIO _more_
   * @return _more_
   * @throws Exception _more_
   */
  public ReadStatus read(RecordIO recordIO) throws Exception {
    super.read(recordIO);
    this.b = readByte(recordIO.getDataInputStream());
    this.s = readShort(recordIO.getDataInputStream());
    this.i = readInt(recordIO.getDataInputStream());
    this.l = readLong(recordIO.getDataInputStream());
    this.d = readDouble(recordIO.getDataInputStream());
    this.f = readFloat(recordIO.getDataInputStream());

    this.u_b = readUnsignedByte(recordIO.getDataInputStream());
    this.u_s = readUnsignedShort(recordIO.getDataInputStream());
    this.u_i = readUnsignedInt(recordIO.getDataInputStream());

    readBytes(recordIO.getDataInputStream(), a_b);
    readShorts(recordIO.getDataInputStream(), a_s);
    readInts(recordIO.getDataInputStream(), a_i);
    readFloats(recordIO.getDataInputStream(), a_f);
    readDoubles(recordIO.getDataInputStream(), a_d);
    readLongs(recordIO.getDataInputStream(), a_l);

    readUnsignedBytes(recordIO.getDataInputStream(), u_a_b);
    readUnsignedShorts(recordIO.getDataInputStream(), u_a_s);
    readUnsignedInts(recordIO.getDataInputStream(), u_a_i);

    return ReadStatus.OK;
  }