CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    98

    stream, pipeline

    Please correct me If I am wrong.

    Say there is file X and process A want to write on file X.

    A stream is a sequence of bytes. In the NTFS file system, streams contain the data that is written to a file.

    We can think of pipeline like a river in jangle. Every river has its own way.
    We can think of stream like fishes swim there.

    The way between process A and file X, is pipeline.Then stream can move in pipeline.

    Is it right?

    Now this line:

    Code:
    FileReader f=new FileReader(thefile);
    or this line

    Code:
    FileInputStream fstream = new FileInputStream("textfile.txt");
    create a stream.

    Bytes go to the buffer first.


    Right?

    Another question:

    The ability to reassign these streams corresponds to what Unix (or DOS command line) users
    think of as redirection, or piping. This mechanism is commonly used to make a program read
    from or write to a file without having to explicitly open it and go through every line of code
    changing the read, write, print, etc., calls to refer to a different stream object. The open operation
    is performed by the command-line interpreter in Unix or DOS, or by the calling class in Java.
    This is from JAVA cookbook , May someone explain about piping?
    Last edited by Abalfazl; August 21st, 2010 at 02:53 PM.

  2. #2
    Join Date
    Jul 2010
    Posts
    17

    Re: stream, pipeline

    Hi,

    I wouldn't read to much into what the author is saying. It appears he is using an analogy to describe the process in a way that most unix users might understand.

    Piping basically lets you take the output from one process and send it to the input of another process. With IO streams you can do something similar. You can read from one source (using an input stream) and 'pipe' it into another source (using an output stream)

    Hope this helps,

    Vackar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured