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();
}

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 ( ) ; }
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 .
