Add methods to Stream.cs