import java.io.IOException;
public class ReadImageFile {
public static void main(String[] args) {
String imagePath = "yourImageFile.jpg"; // Replace with the actual image file path and name
try (FileInputStream fileInputStream = new FileInputStream(imagePath)) {
int byteRead;
while ((byteRead = fileInputStream.read()) != -1) {
System.out.print((char) byteRead);
}
} catch (IOException e) {
System.err.println("Error reading the image file: " + e.getMessage());
}
}
}
No comments:
Post a Comment