added a faster implementation of the ByteArrayOutputStream