private ByteBuffer read() throws LibUsbException {
  if (mDeviceHandle != null) {
    ByteBuffer buffer=ByteBuffer.allocateDirect(64);
    IntBuffer transferred=IntBuffer.allocate(1);
    int result=LibUsb.interruptTransfer(mDeviceHandle,FCD_ENDPOINT_IN,buffer,transferred,500l);
    if (result != LibUsb.SUCCESS) {
      throw new LibUsbException("error reading byte buffer",result);
    }
 else     if (transferred.get(0) != buffer.capacity()) {
      throw new LibUsbException("received bytes [" + transferred.get(0) + "] didn't match expected "+ "length ["+ buffer.capacity()+ "]",result);
    }
    return buffer;
  }
  throw new LibUsbException("device handle is null",LibUsb.ERROR_NO_DEVICE);
}

private ByteBuffer read ( ) throws LibUsbException { if ( mDeviceHandle != null ) { ByteBuffer buffer = ByteBuffer . allocateDirect ( 64 ) ; IntBuffer transferred = IntBuffer . allocate ( 1 ) ; int result = LibUsb . interruptTransfer ( mDeviceHandle , FCD_ENDPOINT_IN , buffer , transferred , 500l ) ; if ( result != LibUsb . SUCCESS ) { throw new LibUsbException ( "error reading byte buffer" , result ) ; } else if ( transferred . get ( 0 ) != buffer . capacity ( ) ) { throw new LibUsbException ( "received bytes [" + transferred . get ( 0 ) + "] didn't match expected " + "length [" + buffer . capacity ( ) + "]" , result ) ; } return buffer ; } throw new LibUsbException ( "device handle is null" , LibUsb . ERROR_NO_DEVICE ) ; }
performs an interrupt read against the endpoint
