/[classpath]/classpath/gnu/java/nio/SocketChannelImpl.java
ViewVC logotype

Diff of /classpath/gnu/java/nio/SocketChannelImpl.java

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

revision 1.10 by mkoch, Fri Mar 14 10:49:10 2003 UTC revision 1.11 by mkoch, Tue May 20 10:34:22 2003 UTC
# Line 193  public class SocketChannelImpl extends S Line 193  public class SocketChannelImpl extends S
193      int bytes = 0;      int bytes = 0;
194      int len = src.position();      int len = src.position();
195    
196      if (src instanceof ByteBufferImpl)      if (src.hasArray ())
197              {        {
198          ByteBufferImpl bi = (ByteBufferImpl) src;          byte[] b = src.array ();
199          byte[]b = bi.array();          bytes = SocketWrite (fd, b, 0, len);
200          bytes = SocketWrite(fd, b, 0, len);        }
             }  
201      else      else
202              {        {
203          byte[]b = new byte[len];          byte[] b = new byte [len];
204          src.get(b, 0, len);          src.get (b, 0, len);
205          bytes = SocketWrite(fd, b, 0, len);          bytes = SocketWrite (fd, b, 0, len);
206              }        }
207                                    
208            return bytes;            return bytes;
209    }    }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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