Switch to byte array.

// FREEBIE
Incorporate PR feedback. Add license and eliminate duplicate code.

// FREEBIE