- return list;
- }
- /**
- * 把输入流转换成字符数组
- * @param inputStream 输入流
- * @return 字符数组
- * @throws Exception
- */
- public static byte[] readStream(InputStream inputStream) throws Exception {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- byte[] buffer = new byte[1024];
- int len = 0;
- while ((len = inputStream.read(buffer)) != -1) {
- bout.write(buffer, 0, len);
- }
- bout.close();
- inputStream.close();
- return bout.toByteArray();
- }
- }
- return list;
- }
- /**
- * 把输入流转换成字符数组
- * @param inputStream 输入流
- * @return 字符数组
- * @throws Exception
- */
- public static byte[] readStream(InputStream inputStream) throws Exception {
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- byte[] buffer = new byte[1024];
- int len = 0;
- while ((len = inputStream.read(buffer)) != -1) {
- bout.write(buffer, 0, len);
- }
- bout.close();
- inputStream.close();
- return bout.toByteArray();
- }
- }