text: public ObjectId idFor(int objectType, long length, InputStream in)throws IOException {SHA1 md = SHA1.newInstance();md.update(Constants.encodedTypeString(objectType));md.update((byte) ' ');md.update(Constants.encodeASCII(length));md.update((byte) 0);byte[] buf = buffer();while (length > 0) {int n = in.read(buf, 0, (int) Math.min(length, buf.length));if (n < 0)throw new EOFException(JGitText.get().unexpectedEndOfInput);md.update(buf, 0, n);length -= n;}return md.toObjectId();}