avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/util StreamConnector.java
Date Sun, 10 Mar 2002 06:09:01 GMT
rana_b      02/03/09 22:09:01

  Modified:    ftpserver/src/java/org/apache/avalon/ftpserver/util
                        StreamConnector.java
  Log:
  buffer size changed
  
  Revision  Changes    Path
  1.4       +9 -8      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/util/StreamConnector.java
  
  Index: StreamConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/util/StreamConnector.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StreamConnector.java	23 Sep 2001 22:42:20 -0000	1.3
  +++ StreamConnector.java	10 Mar 2002 06:09:00 -0000	1.4
  @@ -176,7 +176,7 @@
           mConThread = Thread.currentThread();
           InputStream in = mInStream;
           OutputStream out = mOutStream;
  -        byte[] buff = new byte[512];
  +        byte[] buff = new byte[2048];
           
           if(mbBuffered) {
               in = IoUtils.getBufferedInputStream(in);
  @@ -201,16 +201,16 @@
                          continue;
                      }
                  }
  -
  +                
                  // read data
                  int count = in.read(buff);
                  if(count == -1) {
                      break;
                  }
  -               
  +                               
                  // write data
  -               out.write(buff, 0, count);
  -               mlTransferSize += count;
  +               out.write(buff, 0, count);               
  +               mlTransferSize += count;              
                  notifyObserver(count);
              }
              out.flush();
  @@ -233,9 +233,10 @@
        * Notify the observer.
        * @param sz bytes transferred
        */
  -    private synchronized void notifyObserver(int sz) {
  -        if(mObserver != null) {
  -              mObserver.dataTransferred(sz); 
  +    private void notifyObserver(int sz) {
  +        StreamConnectorObserver observer = mObserver;
  +        if(observer != null) {
  +            observer.dataTransferred(sz); 
           }
       } 
       
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message