+ OutputStream scp_out = channel.getOutputStream();
+ InputStream scp_in = channel.getInputStream();
+
+ /* Okay, BS out of the way. Now go send the file. */
+ expect_ack(scp_in);
+
+ scp_out.write(("C0644 " + (Integer.toString(is.available())) + " lol\n").getBytes());
+ scp_out.flush();
+
+ expect_ack(scp_in);
+
+ int len;
+ byte[] buf = new byte[4096];
+ while ((len = is.read(buf, 0, buf.length)) > 0)
+ scp_out.write(buf, 0, len);
+
+ is.close();
+
+ scp_out.write("\0".getBytes());
+ scp_out.flush();
+
+ expect_ack(scp_in);
+