protected final void writeS(String text,int size){
  if (text == null) {
    buf.put(new byte[size]);
  }
 else {
    final int len=text.length();
    for (int i=0; i < len; i++) {
      buf.putChar(text.charAt(i));
    }
    buf.put(new byte[size - (len * 2)]);
  }
}

protected final void writeS ( String text , int size ) { if ( text == null ) { buf . put ( new byte [ size ] ) ; } else { final int len = text . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { buf . putChar ( text . charAt ( i ) ) ; } buf . put ( new byte [ size - ( len * 2 ) ] ) ; } }
write string to buffer
