static OutputStream prepareCanonicalizerOutputStream(int limit,
boolean relaxedBody, OutputStream dout) {
OutputStream out = dout;
if (limit != -1)
out = new LimitedOutputStream(out, limit);
if (relaxedBody)
out = new RelaxedBodyCanonicalizer(out);
else
out = new SimpleBodyCanonicalizer(out);
return out;