TreeviewCopyright © aleen42 all right reserved, powered by aleen42

IO Back

Stream(一般指數據傳輸的通道)

  • 文件操作
  • 網絡傳輸
  • 網頁加載
  • 標準IO
  • 內存讀寫
基於
字節(Byte) InputStream, OutputStream
字符(Character) Reader, Writer

InputStream

FileInputStream(文件)

ByteArrayInputStream(內存)

StringBufferInputStream

PipedInputStream(管道)

ObjectInputStream(對象)

SequenceInputStream(序列)

AudioInputStream(聲音)

OutputStream

FileOutputStream

ByteArrayOutputStream

PipedOutputStream

ObjectOutputStream

Socket

/* Initialization */
//InputStreamReader(Change Byte-oriented to Character-oriented)
BufferedReader read = new BufferedReader(new InputStreamReader(socket.getInputStream))
PrintWriter write = new PrintWriter(socket.getOutputStream)

/* Operation */
read.readLine();
write.println("something");
write.flush();

File

BufferedReader read = new BufferedReader(new FileReader(String path));
PrintWriter write = new PrintWriter(new BufferedWriter(new FileWriter(String path)));

Standard IO

BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
PrintWriter write = new PrintWriter(System.out, true);
Empty Comments
Sign in GitHub

As the plugin is integrated with a code management system like GitLab or GitHub, you may have to auth with your account before leaving comments around this article.

Notice: This plugin has used Cookie to store your token with an expiration.