file separator

Discussion in 'Java' started by juicy, Dec 6, 2004.

  1. juicy

    juicy Guest

    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..
     
    juicy, Dec 6, 2004
    #1
    1. Advertising

  2. juicy

    Guest

    , Dec 6, 2004
    #2
    1. Advertising

  3. juicy wrote:

    > 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
     
    Michael Borgwardt, Dec 6, 2004
    #3
  4. juicy wrote:
    > 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
     
    Steve Horsley, Dec 7, 2004
    #4
  5. juicy

    juicy Guest

    thanks all...
     
    juicy, Dec 14, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lee Sander
    Replies:
    6
    Views:
    315
    Hendrik van Rooyen
    Jun 1, 2007
  2. Steve Howell
    Replies:
    3
    Views:
    297
    George Sakkis
    Jun 2, 2007
  3. Replies:
    2
    Views:
    275
  4. Ronald Fischer

    wrong File::SEPARATOR ?

    Ronald Fischer, Sep 14, 2007, in forum: Ruby
    Replies:
    10
    Views:
    215
    Phlip
    Sep 26, 2007
  5. Matt Garrish
    Replies:
    9
    Views:
    175
    Matt Garrish
    Jan 17, 2006
Loading...

Share This Page