answersLogoWhite

0


Best Answer

These streams are classified as mode streams as they read and write data from disk files. the classes associated with these streams have constructos that allows us to specify the path of the file to which they are connected. The FileInputStream class allows us to read input from a file in the form of a stream. The FileOutputStream class allows us to write output to a file stream. Example,

FileInputStream inputfile = new FileInputStream ("Empolyee.dat");

FileOutputStream outputfile = new FileOutputStream ("binus.dat");

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the uses of File Input Stream and File Output Stream in java programming?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are input output streams in c plus plus?

The term stream is a generic abstraction that says nothing about the implementation. However, if we use the analogy that gave it its name, a stream of water, we can better understand how a stream works. A water stream allows water to flow from one point to another in one direction only (downstream, with the flow of the current). If we were to throw a stick into the water, it would be carried downstream by the water where it could then be extracted. Sticks can be inserted or extracted automatically by devices, thus allowing information to pass between those devices.A file stream is a stream that is associated with a device representing a file. If the file is upstream then we can use the stream to extract information from the file. When we extract information from a stream, that stream is known as an input stream; it provides us with information. Conversely, if the file were downstream then we can use the stream to insert information into the file. When we insert information into a stream, that stream is known as an output stream; it carries information away from us.An input/output stream is one where we can both insert and extract information. An input/output file stream is a typical example: we can extract data from the file associated with the stream, process the data (modify it in some way), and then insert the modified data back into the same file. To implement an input/output stream, we simply use two streams associated with the same device: one specifically for input operations, the other specifically for output operations. This implementation detail is hidden from the user, so the stream appears to be a bi-directional stream as far as the user is concerned.


C plus plus reading and writing a file?

Use an input file stream (ifstream) to read from a file and an output file stream (ofstream) to write to a file. Both can be found in the <fstream> standard library header.


What are filestream classes in c plus plus?

The file stream classes (ifstream and ofstream) are derivatives of the I/O stream classes (istream and ostream) that are specific to file input and output.


What is meant by input stream?

An input stream is a character sequence device or buffer from which input can be gathered. The standard input stream is usually a keyboard, data file or the output stream from another program. The user of the program can normally decide where standard input may be redirected from when launching the program, typically defaulting to the keyboard.


What is standard input and output error file?

The C standard library provides stderr as the standard error file. It is an output file, much like stdout, except it cannot be redirected via the command line. By default, error messages via stderr are output to the console, the same as the undirected stdout. However, the programmer may choose to redirect stderr to a disk file or allow the user to choose a location via command line switches. Although error messages can also be output to stdout (or indeed to any output stream), it is best to keep error messages separate from the standard output stream. For instance, the user may choose to redirect standard output to a disk file or to the input stream of another program, while error messages are directed to the console.

Related questions

What are input output streams in c plus plus?

The term stream is a generic abstraction that says nothing about the implementation. However, if we use the analogy that gave it its name, a stream of water, we can better understand how a stream works. A water stream allows water to flow from one point to another in one direction only (downstream, with the flow of the current). If we were to throw a stick into the water, it would be carried downstream by the water where it could then be extracted. Sticks can be inserted or extracted automatically by devices, thus allowing information to pass between those devices.A file stream is a stream that is associated with a device representing a file. If the file is upstream then we can use the stream to extract information from the file. When we extract information from a stream, that stream is known as an input stream; it provides us with information. Conversely, if the file were downstream then we can use the stream to insert information into the file. When we insert information into a stream, that stream is known as an output stream; it carries information away from us.An input/output stream is one where we can both insert and extract information. An input/output file stream is a typical example: we can extract data from the file associated with the stream, process the data (modify it in some way), and then insert the modified data back into the same file. To implement an input/output stream, we simply use two streams associated with the same device: one specifically for input operations, the other specifically for output operations. This implementation detail is hidden from the user, so the stream appears to be a bi-directional stream as far as the user is concerned.


What are different input and output functions in C?

The C programming language provides many standard library functions for file input and output. These functions make up the bulk of the C standard library header <stdio.h>. The I/O functionality of C is fairly low-level by modern standards; C abstracts all file operations into operations on streams of bytes, which may be "input streams" or "output streams". Unlike some earlier programming languages, C has no direct support for random-access data files; to read from a record in the middle of a file, the programmer must create a stream, seek to the middle of the file, and then read bytes in sequence from the stream.


C plus plus reading and writing a file?

Use an input file stream (ifstream) to read from a file and an output file stream (ofstream) to write to a file. Both can be found in the <fstream> standard library header.


What are filestream classes in c plus plus?

The file stream classes (ifstream and ofstream) are derivatives of the I/O stream classes (istream and ostream) that are specific to file input and output.


What is meant by input stream?

An input stream is a character sequence device or buffer from which input can be gathered. The standard input stream is usually a keyboard, data file or the output stream from another program. The user of the program can normally decide where standard input may be redirected from when launching the program, typically defaulting to the keyboard.


Does a c plus plus stream is a file yes or no?

Yes, at least as far as C++ is concerned. Although you wouldn't regard the keyboard as being a file, to C++ there is no difference between accepting input from a disk-based file or from the keyboard: they are both streams and therefore they are both files. The same logic applies to the console window or a printer with regards output streams. However, it's probably easier to think of a file stream as being an abstraction. The user can redirect input and output from the command line as they see fit, so the same code will operate regardless of where the input or output is physically directed. Thus a file stream can be regarded as being a conceptual file rather than an actual disk-based file.


What is standard input and output error file?

The C standard library provides stderr as the standard error file. It is an output file, much like stdout, except it cannot be redirected via the command line. By default, error messages via stderr are output to the console, the same as the undirected stdout. However, the programmer may choose to redirect stderr to a disk file or allow the user to choose a location via command line switches. Although error messages can also be output to stdout (or indeed to any output stream), it is best to keep error messages separate from the standard output stream. For instance, the user may choose to redirect standard output to a disk file or to the input stream of another program, while error messages are directed to the console.


What is this percentd in C programming what does input and output mean How do I make the solution include decimal?

The %d designation is a printf format specification that says to interpret the next argument as a signed integer and display the results in base 10 decimal. Input and output is the processing of input data and output data by your program. Usually, input is the stdin file, which is processed by scanf, and output is the stdout file, which is processed by printf. To include a decimal point in the output, you need to use a floating point variable and a floating point specification, such as %f.


What is the meaning of FILE in stdio file in C?

its an standard input and output


VLC can't recognize the input's format?

This may be because the file is corrupted Also make sure you have the right input format selected and make sure there is a check in the check box for "Keep stream output open"


How is file handling applied in c plus plus?

File handling is handled by input stream objects (ifstream) and output stream objects (ofstream), or bi-directional streams (fstream). These classes are derived from istream and ostream. See related links for more information on these classes.


Which header files contain declaration for the files input and output functions and the macros defined and that are used with file input and output functions?

stdio.h