} else if (words[0].equalsIgnoreCase("dcc")) {
int counter = 0;
for (DccReceiver dccReceiver : core.dccReceivers()) {
- write(String.format("[%d] %s (%s, ", counter++, dccReceiver.filename(), dccReceiver.size()));
+ writer.write(String.format("[%d] %s (%s, ", counter++, dccReceiver.filename(), f(dccReceiver.size())));
if (dccReceiver.isRunning()) {
- write(String.format("%.1f%%, %s", dccReceiver.progress() * 100.0 / dccReceiver.size(), f(dccReceiver.currentRate())));
+ writer.write(String.format("%.1f%%, %s", dccReceiver.progress() * 100.0 / dccReceiver.size(), f(dccReceiver.currentRate())));
} else {
if (dccReceiver.progress() >= dccReceiver.size()) {
- write(String.format("complete, %s", f(dccReceiver.overallRate())));
+ writer.write(String.format("complete, %s", f(dccReceiver.overallRate())));
} else {
- write(String.format("aborted at %.1f%%, %s", dccReceiver.progress() * 100.0 / dccReceiver.size(), f(dccReceiver.currentRate())));
+ writer.write(String.format("aborted at %.1f%%, %s", dccReceiver.progress() * 100.0 / dccReceiver.size(), f(dccReceiver.currentRate())));
}
}
- write("/s)\n");
+ writer.write("/s)\n");
}
writeLine("End of DCCs.");
} else if (words[0].equalsIgnoreCase("get")) {
//
/**
- * Writes the given text to the {@link #writer}.
- *
- * @param text
- * The text to write
- * @throws IOException
- * if an I/O error occurs
- */
- private void write(String text) throws IOException {
- writer.write(text);
- writer.flush();
- }
-
- /**
* Writes the given line followed by an LF to the {@link #writer}.
*
* @param line