/[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.1 by dog, Sun Oct 19 08:51:37 2003 UTC revision 1.2 by dog, Sun Oct 19 16:16:49 2003 UTC
# Line 40  import java.io.IOException; Line 40  import java.io.IOException;
40  class StreamInputStream extends DTPInputStream  class StreamInputStream extends DTPInputStream
41  {  {
42    
43          StreamInputStream(DTP dtp, InputStream in)    StreamInputStream(DTP dtp, InputStream in)
44          {    {
45                  super(dtp, in);      super(dtp, in);
46          }    }
47    
48          public int read()    public int read() throws IOException
49                  throws IOException    {
50          {      if (transferComplete)
51                  if (transferComplete)        return -1;
52                          return -1;      int c = super.read();
53                  int c = super.read();      if (c == -1)
54                  if (c==-1)        close();
55                          close();        return c;
56                  return c;    }
         }  
57    
58          public int read(byte[] buf)    public int read(byte[]buf) throws IOException
59                  throws IOException    {
60          {      return read(buf, 0, buf.length);
61                  return read(buf, 0, buf.length);    }
         }  
62    
63          public int read(byte[] buf, int off, int len)    public int read(byte[]buf, int off, int len) throws IOException
64                  throws IOException    {
65          {      if (transferComplete)
66                  if (transferComplete)        return -1;
67                          return -1;      int l = super.read(buf, off, len);
68                  int l = super.read(buf, off, len);      if (l == -1)
69                  if (l==-1)        close();
70                          close();        return l;
71                  return l;    }
         }  
72    
73  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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