View Single Post
Old 09-12-07, 07:00 AM   #3
Official pain in the ass
Tuork's Avatar
Join Date: May 2003
Posts: 1,197
Send a message via MSN to Tuork
Default Re: How to split a file into packets.

Originally Posted by bugmeplz
hi, you can just use FileInputStream to read in the raw bytes from the file you're trying to send to the server. You can use the FileInputStream to read in groups of 256 bytes, and then send them over to the socket on the server end. I am not sure what you mean regarding "how to implement a buffer on the serverside"; it can just be a byte[] that you fill up with the raw bytes sent over from the client. let me know if you have any more questions

BTW: it is rather confusing to use the term "package" since this has a definite meaning in java's jargon
Thanks for the reply.

I did in fact use the InputStream to read raw bytes... same goes for what you mentioned about the buffer.

As for the packet deal, it was just the wording on my assignment that threw me off. What they meant was that I was supposed to send a certain amount of bytes per transmission.

Thanks a bunch!
My avatar: "An obscure and non sensical pattern made to get people to post what they think it is" - Vamp

Dell XPS M1530
Core2Duo T5550 1.86Ghz | 3GB DDR2 | 8600M GT 256MB | 250GB Hdd | BenQ FP202W 20" LCD | MX1000 mouse | Inspire T5400 5.1
Tuork is offline   Reply With Quote