Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Two different streams at same time

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Two different streams at same time

    I have an open Client-server connection thru a socket.

    What I what to do is send some text (coming from keybord) and a file (pdf) to the server.

    So, is it possible to create two types of streams? one for sending text (character stream) and other to send a file (byte stream) ?

    or it can be included all in the same stream? if so, then how can I read the stream in the server ? how do I know where the File begins or where the text begins ?


  2. #2
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Location
    Wales, Bangor & England, Warwickshire
    Posts
    820
    My Mood
    Cynical
    Thanks
    7
    Thanked 104 Times in 90 Posts

    Default Re: Two different streams at same time

    You could create 2 streams on both ends or you could create an obect which can contain any data and then create an object stream.

    Chris
    chris[at]javaprogrammingforums[dot]com

    Prifysgol Bangor University, North Wales

Similar Threads

  1. [SOLVED] file deletion/renaming not successful, don't think I have any streams open
    By Bottleskup in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 21st, 2011, 05:14 PM
  2. [SOLVED] Windows Cmd Prompt streams
    By helloworld922 in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: November 24th, 2010, 10:00 PM
  3. Using time
    By ellias2007 in forum Java Theory & Questions
    Replies: 1
    Last Post: September 4th, 2010, 09:48 AM
  4. data and object streams
    By bbr201 in forum Java Theory & Questions
    Replies: 4
    Last Post: July 16th, 2010, 07:18 PM
  5. reading JMF input streams?
    By wolfgar in forum File I/O & Other I/O Streams
    Replies: 0
    Last Post: January 12th, 2010, 12:22 AM