public Object readLengthList(AbstractHessianInput in, int length) throws IOException {
    Collection list = createList();

    in.addRef(list);

    for (; length > 0; length--) list.add(in.readObject());

    return list;
  }
  public Object readList(AbstractHessianInput in, int length) throws IOException {
    Collection list = createList();

    in.addRef(list);

    while (!in.isEnd()) list.add(in.readObject());

    in.readEnd();

    return list;
  }