public int send(byte[] buffer,int offset,int count){
  checkArrayBounds(buffer,offset,count);
  if (count == 0) {
    return 0;
  }
  byte[] data=buffer;
  if (offset > 0) {
    data=new byte[count];
    System.arraycopy(buffer,offset,data,0,count);
  }
  IntOut bytesSentOut=new IntOut();
  try {
    IDevice.checkResult(LibIMobileDevice.idevice_connection_send(getRef(),data,count,bytesSentOut));
    return bytesSentOut.getValue();
  }
  finally {
    bytesSentOut.delete();
  }
}

public int send ( byte [ ] buffer , int offset , int count ) { checkArrayBounds ( buffer , offset , count ) ; if ( count == 0 ) { return 0 ; } byte [ ] data = buffer ; if ( offset > 0 ) { data = new byte [ count ] ; System . arraycopy ( buffer , offset , data , 0 , count ) ; } IntOut bytesSentOut = new IntOut ( ) ; try { IDevice . checkResult ( LibIMobileDevice . idevice_connection_send ( getRef ( ) , data , count , bytesSentOut ) ) ; return bytesSentOut . getValue ( ) ; } finally { bytesSentOut . delete ( ) ; } }
sends data to the device on this connection .
