title: libusb communicate with USB mass storage
body: <p>I'm currently writing a <a href="http://javax-usb.org/" rel="nofollow">javax-usb (JSR-80)</a> implementation using <a href="http://www.libusb.org/" rel="nofollow">libusb 0.1</a> as a backend. I need to test the bulk transfer functionality and my guess is that the easiest way to do this is to communicate with a USB mass storage device like a USB flash drive. Unfortunately I have no idea how these devices are working. I guess there is some kind of protocol and I have to send some USB control requests before I can initiate a transfer on the bulk endpoints.</p>
  
  <p>I'm not interested in writing a full USB mass storage driver or something like that so even file system stuff doesn't matter. My only purpose is to transfer some data via some bulk endpoint so I can compare my implementation with the reference implementation.</p>
  
  <p>What I need is some example code (Language doesn't matter and most likely it even doesn't matter if it uses libusb or something different) or a specification of USB mass storage which is easy to understand for programmers (I'm no hardware specialist). I already searched the web but haven't found anything useful so far.</p>