text: public virtual ObjectId IdFor(int objectType, long length, InputStream @in){MessageDigest md = Digest();md.Update(Constants.EncodedTypeString(objectType));md.Update(unchecked((byte)' '));md.Update(Constants.EncodeASCII(length));md.Update(unchecked((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("Unexpected end of input");}md.Update(buf, 0, n);length -= n;}return ObjectId.FromRaw(md.Digest());}