protected InputStream readStreamFromRemote(String remoteFile,
				FileTransferProgress progress) throws IOException {
			String cmd;
			String[] cmdParts = new String[3];
			writeOk();

			while (true) {
				try {
					cmd = readString();
				} catch (EOFException e) {
					return null;
				} catch (SshIOException e2) {
					return null;
				}

				char cmdChar = cmd.charAt(0);

				switch (cmdChar) {
				case 'E':
					writeOk();

					return null;

				case 'T':
					continue;

				case 'D':
					throw new IOException(
							"Directories cannot be copied to a stream");

				case 'C':
					parseCommand(cmd, cmdParts);
					long len = Long.parseLong(cmdParts[1]);

					writeOk();

					if (progress != null) {
						progress.started(len, remoteFile);
					}

					return new ScpInputStream(len, in, this, progress,
							remoteFile) /*
										 * , 16 * 1024)
										 */
					;

				default:
					writeError("Unexpected cmd: " + cmd);
					throw new IOException("SCP unexpected cmd: " + cmd);
				}
			}
		}