Exemple #1
0
 @Override
 public void readExternal(ObjectInput in) throws IOException {
   Bytes b = (Bytes) in;
   this.x = b.readStopBit();
   if (this.y == null) this.y = new StringBuilder();
   b.readUTFΔ(this.y);
 }
  public C read(Bytes bytes, @Nullable C c) {
    long length = bytes.readStopBit();

    if (length == 0 && c != null) {
      c.clear();
      return c;
    }

    if (length < NULL_LENGTH || length > Integer.MAX_VALUE)
      throw new IllegalStateException("Invalid length: " + length);

    if (length == NULL_LENGTH) return null;

    if (c == null) c = newCollection();

    return readCollection(bytes, c, (int) length);
  }