Typecast, Flatten, Unflatten, Read File and Write File have all the option to manipulate 4.x data. The only difference between 4.x data and higher version is how the booleans are packed. In 4.x booleans arrays are bit packed 8 booleans/byte; in 5.0 and higher, booleans are byte packed 1 boolean/byte. So if you manipulate flattened data or file data that has been written in 4.x format, you must recover it checking the 4.x option of the nodes.
For example, an array of 80 booleans written on disk in 4.x as [length U32]+ 10 bytes. In >=5.0 it is [length U32]+80 bytes.