예제 #1
0
  /** {@inheritDoc} */
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);

    byte[] data = new byte[in.readInt()];
    in.readFully(data);
    path = new String(data, Constants.DEFAULT_ENCODING);
  }
예제 #2
0
  /** {@inheritDoc} */
  public void writeExternal(ObjectOutput out) throws IOException {
    super.writeExternal(out);

    byte[] data = path.getBytes(Constants.DEFAULT_ENCODING);
    out.writeInt(data.length);
    out.write(data);
  }