how can i convert a liitle Endian binary file into big Endian binary file. i have a binary binary written in C and i am reading this file in Java with DataInputStream which
You can use EndianUtils from Apache Commons I/O:
It has static methods like long readSwappedLong(InputStream input) that can do all the swapping for you. It also has overloads that uses a byte[] as input, as well as write counterpart (to OutputStream or byte[]). It also has non-I/O methods like int swapInteger(int value) methods that can do conversion of plain Java primitives.
The package also has many useful utility classes like FilenameUtils, IOUtils, etc.