Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9091

Re: Adding BOM at beginning of the file in receiver side .txt file

$
0
0

Hi Satish

 

I Think java mapping will be good enough for your requirement. Also UTF-16 requires BOM not UTF-16LE

 

try this code

 

Document newdoc = tbuilder.newDocument();

 

write logic and update the input data to this newdoc.

 

  byte[] BOMByte = {(byte)0xFF,(byte)0xFF};

 

  OutputStream out = arg1.getOutputPayload().getOutputStream();

  out.write(BOMByte);

  Transformer transformer = TransformerFactory.newInstance()

  .newTransformer();

  Source source = new DOMSource(newdoc);

  Result output = new StreamResult(out);

  transformer.setOutputProperty("encoding", "UTF-16");

  transformer.transform(source, output);


Viewing all articles
Browse latest Browse all 9091

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>