From 56e6a9a7d4cf392d89180a75221e6357dc1c1e84 Mon Sep 17 00:00:00 2001 From: ddaa2000 <2470872965@qq.com> Date: Sat, 11 Apr 2020 18:47:43 +0800 Subject: [PATCH] fileSystem added --- .../java/com/codesdream/ase/test/FileSystemTest.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/codesdream/ase/test/FileSystemTest.java b/src/test/java/com/codesdream/ase/test/FileSystemTest.java index 108089b..c80f8d9 100644 --- a/src/test/java/com/codesdream/ase/test/FileSystemTest.java +++ b/src/test/java/com/codesdream/ase/test/FileSystemTest.java @@ -12,6 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner; import javax.annotation.Resource; import java.io.IOException; import java.io.InputStream; +import java.util.Scanner; @SpringBootTest @RunWith(SpringRunner.class) @@ -63,13 +64,9 @@ public class FileSystemTest { InputStream inputStream = fileSystem.getFile(id1); - byte[] bytes = new byte[200]; - try { - inputStream.read(bytes); - } catch (IOException e) { - e.printStackTrace(); - } - System.out.println(bytes.toString()); + Scanner scanner = new Scanner(inputStream, "UTF-8"); + String text = scanner.useDelimiter("\\A").next(); + System.out.println(text); } }