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

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

$
0
0

Hi all,

 

I want to generate .txt file at receiver  with file format UTF-16LE & BOM( beginning of the file).

for this i have written below logic in my custom adapter module, but i was generating file without BOM.

Could you please help me.It's very urgent.

 

//Read XML from payload

//        Adding BOM to output stream
          byte[] BOMByte = {(byte)0xFF,(byte)0xFF};
          out.write(BOMByte);
      TransformerFactory transformerFactory = TransformerFactory.newInstance();

      Transformer transformer = transformerFactory.newTransformer();

//Converting into UTF-16LE Format.

  transformer.setOutputProperty("encoding", "UTF-16LE");
  Result result = new StreamResult(out);

 

 

Regards,

Satish


Viewing all articles
Browse latest Browse all 10116

Trending Articles



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