FLEXI-STREAMS is a library which implements "virtual" bivalent streams that can be layered atop real binary/bivalent streams. It can be used to read and write character data in various single- or multi-octet character encodings which can be changed on the fly. It also supplies in-memory binary streams which are similar to string streams.

It was written by Edi Weitz and can be found at http://weitz.de/flexi-streams/.