Example #1
0
  public Object unmarshal(InputStream is) throws IOException {
    assert !alreadyUnmarshalled;
    FastInputStream dis = FastInputStream.wrap(is);
    version = dis.readByte();
    if (version != VERSION) {
      throw new RuntimeException(
          "Invalid version (expected "
              + VERSION
              + ", but "
              + version
              + ") or the data in not in 'javabin' format");
    }

    alreadyUnmarshalled = true;
    return readVal(dis);
  }