reduce memory usage while reading help file
This commit is contained in:
parent
4ba6832845
commit
8f131a0129
|
@ -10,7 +10,6 @@ import java.io.BufferedInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
boolean help_enqueued = false;
|
boolean help_enqueued = false;
|
||||||
boolean allow_networking = true;
|
boolean allow_networking = true;
|
||||||
|
@ -80,14 +79,12 @@ public class Main {
|
||||||
}
|
}
|
||||||
|
|
||||||
Scanner help_file_scanner = new Scanner(help_file);
|
Scanner help_file_scanner = new Scanner(help_file);
|
||||||
String help_text = "";
|
|
||||||
|
|
||||||
while (help_file_scanner.hasNextLine()) {
|
while (help_file_scanner.hasNextLine()) {
|
||||||
help_text += help_file_scanner.nextLine();
|
System.out.print(help_file_scanner.nextLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
help_file_scanner.close();
|
help_file_scanner.close();
|
||||||
System.out.println(help_text);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("[ERROR] Failed to read help due to the following exception: " + e);
|
System.out.println("[ERROR] Failed to read help due to the following exception: " + e);
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
|
|
Loading…
Reference in New Issue