1、文件转化成流
//声明文件
File file = new File("文件.txt")
//将文件转为FileInputStream
FileInputStream fis = new FileInputStream(file);
2、字符串转化成流
//声明字符串
String agreement=“123”;
//将字符串转为InputStream
InputStream in =new ByteArrayInputStream(agreement.getBytes());