Reading a Hex File

hi i want to read a Hex File.can anybody help mebye Amit
[84 byte] By [amit_ary] at [2007-9-27 21:23:50]
# 1

What exactly are you trying to accomplish? In any case, to read any kind of a file into a byte array, do the following:

import java.io.BufferedInputStream;

import java.io.FileInputStream;

public class ReadFile {

public static void main(String[] args) throws Exception {

BufferedInputStream stream =

new BufferedInputStream(new FileInputStream("your_filename"));

byte[] bytes = new byte[stream.available()];

stream.read(bytes, 0, bytes.length);

}

}

Zetor at 2007-7-7 3:18:46 > top of Java-index,Archived Forums,Java Programming...