From 4f4f90ecdc84799e05f9e463fd6a90c3b01a7130 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 2 Aug 2016 21:23:47 +0800 Subject: [PATCH] Support reader.readLine() --- source/net/filebot/cli/ScriptShellBaseClass.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/cli/ScriptShellBaseClass.java b/source/net/filebot/cli/ScriptShellBaseClass.java index 3ff8b527..b370b73c 100644 --- a/source/net/filebot/cli/ScriptShellBaseClass.java +++ b/source/net/filebot/cli/ScriptShellBaseClass.java @@ -6,6 +6,7 @@ import static net.filebot.Logging.*; import static net.filebot.media.XattrMetaInfo.*; import static net.filebot.util.StringUtilities.*; +import java.io.BufferedReader; import java.io.File; import java.io.FileFilter; import java.io.IOException; @@ -286,7 +287,7 @@ public abstract class ScriptShellBaseClass extends Script { public void telnet(String host, int port, Closure handler) throws IOException { try (Socket socket = new Socket(host, port)) { - handler.call(new PrintStream(socket.getOutputStream(), true, "UTF-8"), new InputStreamReader(socket.getInputStream(), "UTF-8")); + handler.call(new PrintStream(socket.getOutputStream(), true, "UTF-8"), new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8"))); } }