implementation of SourceStream.getDecoder but untested