springboot 그림의 흐름 읽기

502 단어 처음
String logo1=list.get(i).getLogo();
File file = new File(logo1);
FileInputStream inputStream = null;
try {
    inputStream = new FileInputStream(file);
} catch (FileNotFoundException e) {
    e.printStackTrace();
}
byte[] bytes = new byte[inputStream.available()];
inputStream.read(bytes, 0, inputStream.available());
// byte[]   String  
String logo2=new String(bytes);
sp.setLogo(logo2);

설명: 여기 로고1은 그림의 저장 주소를 얻는 것입니다. 간단하지 않습니까? 이 로고는 그림이 2진 흐름으로 변환되는 형식으로 문자열에 해당합니다.

좋은 웹페이지 즐겨찾기