question: public void writeString ( final String s ) { final byte [ ] bytes = s . getBytes ( ) ; final int len = bytes . length ; writeInt ( len ) ; System . arraycopy ( bytes , 0 , buffer , offset , len ) ; offset += len ; pad ( ) ; }
target:  Puts a string into the buffer by first writing the size of the string as an int, followed by the bytes of the string, padded if necessary to a multiple of 4.