Add more options for writing messages to OutputStream and byte[]