code: public static byte[] readBytesFromOtherInputStream(InputStream is) throws IOException
      {
          ByteArrayOutputStream data = new ByteArrayOutputStream();
  
          int readBytes;
          byte[] buffer = new byte[Math.max(is.available(), 4096)]; // 最低4KB的缓冲区
  
          while ((readBytes = is.read(buffer, 0, buffer.length)) != -1)
          {
              data.write(buffer, 0, readBytes);
          }
  
          data.flush();
  
          return data.toByteArray();
      }
docs: 将非FileInputStream的某InputStream中的全部数据读入到字节数组中
  
  @param is
  @return
  @throws IOException