• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading binary data  RSS feed

 
Nikhil Bansal
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I do have a file in binary format which has got EBCIDC data. I want to read this file byte by byte.Once read then I need to compare the code page of EBCIDC with tht of ASCII. My main task is to convert the EBCIDC data to ASCII format.

Plz i need the code very urgently.

Regards

Nikhil
 
Paul Clapham
Sheriff
Posts: 22509
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to read the text from that file, assuming that it's EBCDIC? Then do something like this:and then read characters from that Reader. You can wrap it in a BufferedReader if you want to read a line at a time.

However, there are many EBCDICs. My example assumed CCSID = 37, but your file may be encoded with a different CCSID. If it is, change the "cp037" part of that example to match. Here's a table of the possibilities:

http://en.wikipedia.org/wiki/EBCDIC_8859

They mostly differ in the non-ASCII characters, I believe.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!