1:import java.io.*; 2: 3:public class bmp_info 4:{ 5: 6: public static void main(String args[]) 7: { 8: try 9: { 10: FileInputStream fis=new FileInputStream(new File("Acrobat.bmp")); 11: DataInputStream dis=new DataInputStream(fis); 12: 13: System.out.println("\n\n\nInformacion de un archivo BMP"); 14: System.out.println("WARNING: estos datos son erroneos, este header es para la version 3/1991"); 15: System.out.println("ASCII: "+dis.readShort()); 16: System.out.println("File size: "+dis.readInt()); 17: System.out.println("unused: "+dis.readShort()); 18: System.out.println("unused: "+dis.readShort()); 19: System.out.println("Offset to image: "+dis.readInt()); 20: System.out.println("Header size: "+dis.readInt()); 21: System.out.println("Width: "+dis.readInt()); 22: System.out.println("Height: "+dis.readInt()); 23: fis.close(); 24: dis.close(); 25: 26: fis=new FileInputStream(new File("Acrobat.ras")); 27: dis=new DataInputStream(fis); 28: System.out.println("\n\n\nInformacion de un archivo RAS"); 29: System.out.println("Magic: "+dis.readInt()); 30: System.out.println("Width: "+dis.readInt()); 31: System.out.println("Height: "+dis.readInt()); 32: System.out.println("Depth: "+dis.readInt()); 33: System.out.println("Length: "+dis.readInt()); 34: fis.close(); 35: dis.close(); 36: }catch(Exception e){e.printStackTrace(); } 37: 38: 39: 40: } 41: 42: 43:}