Fix duplication of string encodings and add Java-based stream reader and encoder