Blob binPhoto = face.getFacephoto();
BufferedInputStream binis = new BufferedInputStream(binPhoto.getBinaryStream());
ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
byte[] buff = new byte[100];
int rc = 0;
while ((rc = binis.read(buff, 0, 100)) > 0) {
swapStream.write(buff, 0, rc);
}
return Base64.encode(swapStream.toByteArray());
二进制照片转base64
最新推荐文章于 2024-05-31 09:05:13 发布