Pre-create an array with all of the bytes in there and have it as a static field. You can than just use writeBytes(...) and do a "bulk" operation. This is quite faster...