removed repetitions of getBytes() call during string serialization (#4)