流转二进制

1  public static byte[] toByteArray(InputStream in) throws IOException {
2         ByteArrayOutputStream out=new ByteArrayOutputStream();
3         byte[] buffer=new byte[1024*4];
4         int n=0;
5         while ( (n=in.read(buffer)) !=-1) {
6             out.write(buffer,0,n);
7         }
8         return out.toByteArray();
9   }

二进制转流

1 public static byte[] toInputStream(byte[] b) throws IOException {
2    returnInputStream inputStream = new ByteArrayInputStream(b);
3 }

 

相关文章:

  • 2022-01-01
  • 2021-12-06
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-23
  • 2021-09-20
  • 2021-10-31
  • 2021-06-28
  • 2022-01-06
相关资源
相似解决方案