0

我已经看到使用类似图像执行此操作的示例:

public void getFile(FileUploadEvent archivo) {
  UploadedFile uploadedFile = archivo.getFile();
  byte[] bytes = IOUtils.toByteArray(uploadedFile.getInputstream());
  BufferedImage bufferedImage = ImageIO.read(new ByteArrayInputStream(bytes));  
  int width = bufferedImage.getWidth();
  int height = bufferedImage.getHeight();
}

但是,这应该适用于 mp3、mp4 或 mov 吗?或者还有其他方法可以获取这些信息?我一直在寻找一个例子,但没有找到任何东西。

4

0 回答 0