Array is built before writing to our output stream