+
+ private String readLine(BufferedReader in) throws IOException {
+ String line = in.readLine();
+ if (line != null) {
+ bytesReceived += line.length();
+ if (crypt != null) {
+ line = crypt.decrypt64s(line, false);
+ }
+ }
+
+ return line;
+ }
+
+ private void writeLine(OutputStreamWriter out, String line)
+ throws IOException {
+ if (crypt == null) {
+ out.write(line);
+ bytesSent += line.length();
+ } else {
+ // TODO: how NOT to create so many big Strings?
+ String b64 = crypt.encrypt64(line, false);
+ out.write(b64);
+ bytesSent += b64.length();
+ }
+ out.write("\n");
+ bytesSent++;
+ }