A stream file is a randomly accessible sequence of bytes, with no further structure imposed by the system.
The integrated file system provides support for storing and operating on information in the form of stream files. Documents that are stored in your server's folders are stream files. Other examples of stream files are PC files and the files in UNIX® systems. An integrated file system stream file is a system object that has an object type of *STMF.
To better understand stream files, it is useful to compare them with iSeries™ database files. A database file is record-oriented; it has predefined subdivisions that consist of one or more fields that have specific characteristics, such as length and data type.
Stream files and record-oriented files are structured differently, and this difference in structure affects how the files are used. The structure affects how an application is written to interact with the files and where each type of file is best used in an application. A record-oriented file, for example, is well suited for storing customer statistics such as name, address, and account balance. A record-oriented file allows these predefined fields to be individually accessed and manipulated, using the extensive programming facilities of your server. But a stream file is better suited for storing information such as a customer's picture, which is composed of a continuous string of bits representing variations in color. Stream files are particularly well suited for storing strings of data such as the text of a document, images, audio, and video.
A *TYPE1 stream file has the same format as stream files created on releases before OS/400® V4R4.
*TYPE1 stream file has a minimum size of 4096 bytes. *TYPE1 stream files have a maximum object size of approximately 128 GB (1 GB equals approximately 1 073 741 824 bytes).
A *TYPE2 stream file has high-performance file access.
*TYPE2 stream files have a maximum object size of approximately 1 TB (1 TB equals approximately 1 099 511 627 776 bytes) in the "root" (/), QOpenSys and user-defined file systems. Otherwise, the maximum is approximately 256 GB. It is also capable of memory mapping, as well as the ability to specify an attribute to optimize main storage allocation. All files created with OS/400 V4R4 and newer systems are *TYPE2 stream files, unless they were created in a user-defined file system that specified a file format of *TYPE1.