file separator

J

juicy

Can anyone tell me how to do file separator?
i am trying to send a directory requested by client. I separate file name
and file data with '}', the client and server program encounter an
exception of socketoutputstream and inputstream. And i have found that
because i use writeBytes in server to write the all files data to buffer,
and without put file separator, so when at receiving site, it only can
receive first file only..
 
M

Michael Borgwardt

juicy said:
Can anyone tell me how to do file separator?
i am trying to send a directory requested by client. I separate file name
and file data with '}', the client and server program encounter an
exception of socketoutputstream and inputstream. And i have found that
because i use writeBytes in server to write the all files data to buffer,
and without put file separator, so when at receiving site, it only can
receive first file only..

http://www.catb.org/~esr/faqs/smart-questions.html#writewell
http://www.physci.org/codes/sscce.jsp
 
S

Steve Horsley

juicy said:
Can anyone tell me how to do file separator?
i am trying to send a directory requested by client. I separate file name
and file data with '}', the client and server program encounter an
exception of socketoutputstream and inputstream. And i have found that
because i use writeBytes in server to write the all files data to buffer,
and without put file separator, so when at receiving site, it only can
receive first file only..
Send the file length first, so the receiving program knows when to stop
copying bytes to file and look for another file header message. This is
how HTTP sends binary files.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top