The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

File over streams

Posted by Matt Gerrans on December 06, 2001 at 10:40 PM

You could preface your sending of the file with a bit of information, like how many bytes it will be, what its name is and so on. This essentially amounts to thinking a little bit about a protocol; you can devise a pretty simple little protocol that starts each transfer with some info about the transfer (size, name and any other useful information). After the receiver gets each transfer, it awaits another "header."

- mfg


> I want to send a file over a stream but i dont want to close the stream when the file is sent. How can i let the receiver know that the file is sent so it can stop its filewriting?





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us