You can try using java.io.FileInputStream and java.io.FileOutputStream. These classes are helpful for reading and writing streams of raw bytes such as image data.
I would also suggest to take a look at classes in java.net package for number of different connections.