Add cappacity paramter: Output out = new Output(outStream,
buffer.capacity());