Io in Java

Source: Internet
Author: User

What is a file
Files can be thought of as related records or data sets that are put together

To read and write files through streams
A stream is a series of flowing characters, a channel that sends information in FIFO mode.
The input and output stream is relative to the memory of the computer

The byte stream is a eight-bit universal byte stream, and the character stream is a 16-bit uncode character stream

Read and write text files
Read and write text files with FileInputStream and FileOutputStream
Read and write text files with BufferedReader and BufferedWriter

Binary file read/write
Read and write binary files using DataInputStream and DataOutputStream

BYTE stream
1 input stream
Base class: Inputstrream
Sub-Category: FileInputStream
Structure:
FileInputStream (File file)
FileInputStream (String name)
Method:
int read () bytes returned in bytes
Read (byte [] b) reads a byte array to return the length of the read-in byte array
Read (Byte [] b,int off,int len)

Io in Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.