/[classpath]/inetlib/source/gnu/inet/ftp/StreamInputStream.java
ViewVC logotype

Diff of /inetlib/source/gnu/inet/ftp/StreamInputStream.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by dog, Thu Oct 21 15:21:54 2004 UTC revision 1.6 by dog, Thu Nov 25 22:15:05 2004 UTC
# Line 1  Line 1 
1  /*  /*
2   * $Id$   * StreamInputStream.java
3   * Copyright (C) 2003 The Free Software Foundation   * Copyright (C) 2003 The Free Software Foundation
4   *   *
5   * This file is part of GNU inetlib, a library.   * This file is part of GNU inetlib, a library.
# Line 46  import java.io.IOException; Line 46  import java.io.IOException;
46   * A DTP input stream that implements the FTP stream data transfer mode.   * A DTP input stream that implements the FTP stream data transfer mode.
47   *   *
48   * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>   * @author <a href='mailto:dog@gnu.org'>Chris Burdess</a>
  * @version $Revision$ $Date$  
49   */   */
50  class StreamInputStream extends DTPInputStream  class StreamInputStream
51      extends DTPInputStream
52  {  {
53    
54    StreamInputStream (DTP dtp, InputStream in)    StreamInputStream(DTP dtp, InputStream in)
55      {    {
56        super (dtp, in);      super(dtp, in);
57      }    }
58      
59    public int read () throws IOException    public int read()
60      {      throws IOException
61        if (transferComplete)    {
62          {      if (transferComplete)
63            return -1;        {
64          }          return -1;
65        int c = in.read ();        }
66        if (c == -1)      int c = in.read();
67          {      if (c == -1)
68            close ();        {
69          }          close();
70        return c;        }
71      }      return c;
72      }
73    public int read (byte[] buf) throws IOException  
74      {    public int read(byte[] buf)
75        return read (buf, 0, buf.length);      throws IOException
76      }    {
77        return read(buf, 0, buf.length);
78    public int read (byte[] buf, int off, int len) throws IOException    }
79      {  
80        if (transferComplete)    public int read(byte[] buf, int off, int len)
81          {      throws IOException
82            return -1;    {
83          }      if (transferComplete)
84        int l = in.read (buf, off, len);        {
85        if (l == -1)          return -1;
86          {        }
87            close ();      int l = in.read(buf, off, len);
88          }      if (l == -1)
89        return l;        {
90      }          close();
91          }
92        return l;
93      }
94    
95  }  }
96    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26