public String test(){
String path="D:\\userphotos\\a.jpg";
File file = new File(path);
FileInputStream fis = new FileInputStream(file);
byte[] buf = new byte[fis.available()];
StringBuffer str2 = new StringBuffer("");
fis.read(buf);
for (byte bs : buf) {
str2.append(Integer.toBinaryString(bs));//转换成二进制
}
int size =str2.length();//二进制的大小