@Override public RevCommit read(ObjectId id, InputStream rawData) throws IllegalArgumentException { DataInput in = new DataInputStream(rawData); try { requireHeader(in, "commit"); return readCommit(id, in); } catch (IOException e) { Throwables.throwIfUnchecked(e); throw new RuntimeException(e); } }
@Override public RevCommit read(ObjectId id, InputStream rawData) throws IllegalArgumentException { DataInput in = new DataInputStream(rawData); try { requireHeader(in, "commit"); return readCommit(id, in); } catch (IOException e) { Throwables.propagate(e); } throw new IllegalStateException( "Unexpected state: neither succeeded nor threw exception while trying to read commit " + id); }
@Override public RevObject read(ObjectId id, InputStream rawData) throws IOException { DataInput in = new DataInputStream(rawData); String header = readToMarker(in, NUL); if ("commit".equals(header)) return readCommit(id, in); else if ("tree".equals(header)) return readTree(id, in); else if ("feature".equals(header)) return readFeature(id, in); else if ("featuretype".equals(header)) return readFeatureType(id, in); else if ("tag".equals(header)) return readTag(id, in); else throw new IllegalArgumentException("Unrecognized object header: " + header); }
@Override public RevObject read(ObjectId id, InputStream rawData) throws IOException { DataInput in = new DataInputStream(rawData); String header = readToMarker(in, NUL); if ("commit".equals(header)) return readCommit(id, in); else if ("tree".equals(header)) return readTree(id, in); else if ("feature".equals(header)) return readFeature(id, in); else if ("featuretype".equals(header)) return readFeatureType(id, in); else if ("tag".equals(header)) return readTag(id, in); else throw new IllegalArgumentException("Unrecognized object header: " + header); }