code: public static byte[] getFileByteContent(InputStream is, String encoding) throws IOException{
          byte[] buffer = new byte[1024];
          int len;
          ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
          while((len = is.read(buffer)) != -1){
              outputStream.write(buffer, 0, len);
          }
          outputStream.close();
          is.close();
          return outputStream.toByteArray();
      }
docs: 按照指定编码获取输入流字节内容
  @param is 输入流
  @param encoding 编码
  @return 字节数组
  @throws IOException io exception