socket.getOutputStream().write (data, 0, len);
System.out.println ("INTERNAL: writing to socket outputstream");  OutputStream output = socket.getOutputStream(); output.write (data, offset, len);
  public int write (ByteBuffer src)    throws IOException  {    byte[] data;    int bytes = 0;    int len = src.remaining ();        if (!src.hasArray ())      {        data = new byte [len];        src.get (data, 0, len);      }    else      {        data = src.array ();      }       socket.getOutputStream().write (data, 0, len);    return len;  }