// 指定图片文件路径
String imagePath = "/mnt/data/upload/ceshi.png";
// 创建文件对象
File imageFile = new File(imagePath);
// 创建文件输入流
FileInputStream fis = new FileInputStream(imageFile);
// 创建文件输入流
FileInputStream fis = new FileInputStream(imageFile);
// 创建字节数组来保存图片数据
byte[] imageData = new byte[(int) imageFile.length()];
// 读取图片数据到字节数组
fis.read(imageData);
// 关闭输入流
fis.close();
// 打印读取到的图片数据长度
System.out.println("Image data length: " + imageData.length);
// 在这里可以对图片数据进行进一步处理,例如将其写入到另一个文件中或者进行图像处理操作