private ByteBuffer writeString(CharsetEncoder encoder,String next,int i,int noOfValues) throws CharacterCodingException {
  ByteBuffer bb;
  if ((i + 1) == noOfValues) {
    bb=encoder.encode(CharBuffer.wrap(next));
  }
 else {
    if (isNullSeperateMultipleValues()) {
      bb=encoder.encode(CharBuffer.wrap(next + '\0'));
    }
 else {
      bb=encoder.encode(CharBuffer.wrap(next));
    }
  }
  bb.rewind();
  return bb;
}

private ByteBuffer writeString ( CharsetEncoder encoder , String next , int i , int noOfValues ) throws CharacterCodingException { ByteBuffer bb ; if ( ( i + 1 ) == noOfValues ) { bb = encoder . encode ( CharBuffer . wrap ( next ) ) ; } else { if ( isNullSeperateMultipleValues ( ) ) { bb = encoder . encode ( CharBuffer . wrap ( next + '\0' ) ) ; } else { bb = encoder . encode ( CharBuffer . wrap ( next ) ) ; } } bb . rewind ( ) ; return bb ; }
write string using specified encoding when this is called multiple times , all but the last value has a trailing null
