P2P File Sharing app. Help would be very appreciated.

Hello,

I'm writing a p2p application as part of something for my uni, and have encountered a problem I can't seem to find a solution for.

A peer on the application sends out a query message to all active peers which returns who has the file specified. I then need the app to split the file into a specified number of bytes, and download a piece from each peer over TCP.

The peer who initiated the query would then reassemble the file.

The problem is I can't seem to find anything in the library which would allow me to split the file, or reassemble it. I've found some source as to transferring a file over TCP (using output stream) but if someone can also offer a better suggestion i would really welcome it.

Thanks,

M

[767 byte] By [MStrzalkowskia] at [2007-11-27 4:16:33]
# 1

you might want to look at random access file to access any part of the file so some clients will access 1 part and other a diff part and on the server you will be able to go back and forth in the file and write the needed parts.

of course you will have to make it much smarter and bullet proof.

sushika at 2007-7-12 9:23:05 > top of Java-index,Java Mobility Forums,Consumer and Commerce...