improve perf of output stream byte array writing, fix bug in ResizeableByteBuffer not keeping to max size