Review completely the javalib

The name of this method is misleading. It almost *never* grows the output buffer. How about `createOutputSpace` or something like that?