The commands in Sftp.java are read in using:
This is only OK is the input is a tty. If stdin is a file (for example a
it will read 1024 bytes and get a corrupt command. The minimal change is:
BufferedReader in_rdr = new BufferedReader(new
However a better approach might be to use StringBuffer rather than byte
The contents of this email and any attachments are sent for the personal attention
of the addressee(s) only and may be confidential. If you are not the intended
addressee, any use, disclosure or copying of this email and any attachments is
unauthorised - please notify the sender by return and delete the message. Any
representations or commitments expressed in this email are subject to contract.
ntl Group Limited
+-From: Graeme Vetterlein <Graeme.Vetterlein@...> --
|_Date: Fri, 7 Feb 2003 17:40:42 -0000 _________________
|The commands in Sftp.java are read in using:
|This is only OK is the input is a tty. If stdin is a file (for
|example a here document) it will read 1024 bytes and get a corrupt
|However a better approach might be to use StringBuffer rather than
I agree with you. It is just an example and that is from my laziness.
I think StreamTokenizer should be used instead of reading and parsing directly.