Input & outputlast modified July 6, 2020This chapter is dedicated to input & output in Visual Basic. Theinput & output in Visual Basic is based on streams.Streams are objects to work with input & output. A stream is anabstraction of a sequence of bytes, such as a file, an input/outputdevice, an inter-process communication pipe, or a TCP/IP socket.In Visual Basic, we have aStreamclass that is an abstract class forall streams. There are additional classes that derive from theStream class and make the programming a lot easier.MemoryStreamAMemoryStreamis a stream which works with data in a computermemory.Option Strict OnImports System.IOModule ExampleSub Main()Dim ms As Stream = New MemoryStream(6)ms.WriteByte(9)ms.WriteByte(11)ms.WriteByte(6)ms.WriteByte(8)ms.WriteByte(3)ms.WriteByte(7)ms.Position = 0Dim rs As Integerrs = ms.ReadByte()Do While rs <> -1Console.WriteLine(rs)rs = ms.ReadByte()Loop