/[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.2 by dog, Sun Oct 19 16:16:49 2003 UTC revision 1.3 by dog, Mon Nov 10 12:29:56 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() throws IOException
49        {
50            if (transferComplete)
51                return -1;
52            int c = in.read();
53            if (c == -1)
54                close();
55            return c;
56        }
57        
58        public int read(byte[] buf) throws IOException
59        {
60            return read(buf, 0, buf.length);
61        }
62    
63    public int read() throws IOException      public int read(byte[] buf, int off, int len) throws IOException
64    {      {
65      if (transferComplete)          if (transferComplete)
66        return -1;              return -1;
67      int c = super.read();          int l = in.read(buf, off, len);
68      if (c == -1)          if (l == -1)
69        close();              close();
70        return c;          return l;
71    }      }
   
   public int read(byte[]buf) throws IOException  
   {  
     return read(buf, 0, buf.length);  
   }  
   
   public int read(byte[]buf, int off, int len) throws IOException  
   {  
     if (transferComplete)  
       return -1;  
     int l = super.read(buf, off, len);  
     if (l == -1)  
       close();  
       return l;  
   }  
72    
73  }  }

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

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