|
|
|
@ -38,14 +38,18 @@ public final class QrCodeGeneratorWorker {
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
// Set up input stream and start loop
|
|
|
|
|
Scanner input = new Scanner(System.in, "US-ASCII");
|
|
|
|
|
try (Scanner input = new Scanner(System.in, "US-ASCII")) {
|
|
|
|
|
input.useDelimiter("\r\n|\n|\r");
|
|
|
|
|
while (true) {
|
|
|
|
|
while (processCase(input));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean processCase(Scanner input) {
|
|
|
|
|
// Read data length or exit
|
|
|
|
|
int length = input.nextInt();
|
|
|
|
|
if (length == -1)
|
|
|
|
|
break;
|
|
|
|
|
return false;
|
|
|
|
|
if (length > Short.MAX_VALUE)
|
|
|
|
|
throw new RuntimeException();
|
|
|
|
|
|
|
|
|
@ -93,7 +97,7 @@ public final class QrCodeGeneratorWorker {
|
|
|
|
|
System.out.println(-1);
|
|
|
|
|
}
|
|
|
|
|
System.out.flush();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|