move char array caching to streams