public ByteArrayDataSource(String stringData,String charSetName,String type){
  if (charSetName == null || charSetName.length() == 0)   charSetName="UTF-8";
  try {
    m_data=stringData.getBytes(charSetName);
  }
 catch (  UnsupportedEncodingException uex) {
    log.log(Level.WARNING,"CharSetName=" + charSetName,uex);
  }
  if (type != null && type.length() > 0)   m_type=type;
}

public ByteArrayDataSource ( String stringData , String charSetName , String type ) { if ( charSetName == null || charSetName . length ( ) == 0 ) charSetName = "UTF-8" ; try { m_data = stringData . getBytes ( charSetName ) ; } catch ( UnsupportedEncodingException uex ) { log . log ( Level . WARNING , "CharSetName=" + charSetName , uex ) ; } if ( type != null && type . length ( ) > 0 ) m_type = type ; }
create a datasource from a string
