网上没搜到,记录一下
ByteString 是protobuf的bytes类型生成后对应的java类型
ByteString fileStream = request.getFileStream();
byte[] bytes = fileStream.toByteArray();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
inputstream转bytestring
InputStream objectContent = ossObject.getObjectContent();
ByteString bytes = null;
try {
bytes = ByteString.readFrom(objectContent);
} catch (IOException e) {
e.printStackTrace();
}