Major refactor of ContentInputStream and ContentOutputStream to create a
memory pool shared between all instances created by the same factory.