Read byte array from file using DataInputStream : DataInputStream « File Input Output « Java
- Java
- File Input Output
- DataInputStream
Read byte array from file using DataInputStream
import java.io.DataInputStream;
import java.io.FileInputStream;
public class Main {
public static void main(String[] args) throws Exception {
FileInputStream fin = new FileInputStream("C:/Array.txt");
DataInputStream din = new DataInputStream(fin);
byte b[] = new byte[10];
din.read(b);
din.close();
}
}
Related examples in the same category