I need to extract restaurants from a planet.osm.pbf file. I assume the best way to do this is with Osmosis, however I need to save this data in my own database format. (Not something standard like Postgres or something else with existing plugins). Therefore, I need to write a Java application to do this, yet the Osmosis documentation seems very confusing to me. What I need to do is this:

Pseudocode:

    while(file.hasNext("amenity=restaurant"))
    {
         Amenity restaurant = this.amenity;
         String street = restaurant.street;
         String city = restaurant.city;
         String region = restaurant.region;
         String name = restaurant.name;
         String cuisine = restaurant.cuisine;
         // I do my own thing with this information here...
    }
I can read the file in with FileInputStream, etc... I just don't understand how to parse and extract data specifically.

I think this information would be extremely valuable to people like me, allowing people to extract this data and use it how they like in their own systems.