Untitled
unknown
java
2 years ago
767 B
4
Indexable
package app;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
public class UD2Ejer801 {
public static void main(String[] args) {
File fichIn = new File("./datos/paisaje_8.bmp");
final int BUFFER_SIZE = 54;
try (
InputStream ficheroEntrada = new FileInputStream(fichIn);) {
byte[] buf = new byte[BUFFER_SIZE];
ficheroEntrada.read(buf, 0, BUFFER_SIZE);
System.out.println((char)buf[0]);
System.out.println((char)buf[1]);
} catch (Exception errorDeFichero) {
System.out.println("Ha habido problemas: " + errorDeFichero.getMessage());
}
System.out.println("Terminado!");
}
}Editor is loading...