implement IStream.