JPEG 인코더를 사용하여 이미지를 압축하고 파일에 쓰는 대신 압축 된 데이터를 다른 응용 프로그램에 전달하고 싶습니다. 내 문제는 데이터를 압축 할 수 있지만 압축 된 이미지 데이터를 가져 오는 방법을 모르는 것입니다. 이 코드를 사용하고 있습니다 :Java의 JPEG 인코더에서 압축 된 이미지 데이터를 얻는 방법
out = new FileOutputStream (filename);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder (out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam (bi);
param.setQuality (0.3f, false);
encoder.setJPEGEncodeParam (param);
encoder.encode (bi);
out.close();