change string to conform with Java's DataInputStream