import java.io.FileInputStream;
import java.io.IOException;
public class MainClass {
public static void main(String[] argv) {
byte b;
byte bytes[] = new byte[100];
byte morebytes[] = new byte[50];
try {
FileInputStream fis = new FileInputStream("fname");
b = (byte) fis.read(); // Single byte
fis.read(bytes); // Fill the array
fis.read(morebytes, 0, 20); // 1st 20 elements
fis.close();
} catch (IOException e) {
}
}
}
|