# Stream & Buffer



![](https://1374779285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MFW3x2aqEO8GF2kr3VU%2Fuploads%2FsshmX5ns3113oqpk0Mq4%2Fscreenshot-www.udemy.com-2022.11.11-17_59_53.png?alt=media\&token=4321223e-52ac-4634-b210-c3147df35843)

* File itself is composed by binary data
* Buffer is to represent the binary data containing a number of byte
* Due to the memory size of program is limited, it is not allowed to use buffer to hold too many bytes
* Stream is basically a on-going process, to let you divide the large size of data into chunk and transfer in batch
* With the definition of larger buffer size, it can reduce the number of i/o of file from disk, in order to improve the speed of reading or writing the file
* As the buffer size is constant, so the file can be processed constantly
