New BinaryWriter(FileStream aFileStream) : BinaryWriter « System.IO « VB.Net by API






New BinaryWriter(FileStream aFileStream)

   

Imports System
Imports System.IO

Public Class MainClass

  Shared Sub Main()

    Dim aFileStream As FileStream
    Try
      aFileStream = New FileStream("test.txt", FileMode.OpenOrCreate,FileAccess.Write)
      Dim myBinaryWriter As New BinaryWriter(aFileStream)
      myBinaryWriter.Write("Hello world")
      myBinaryWriter.Write(1)
    Catch e As Exception
      Console.WriteLine(e.StackTrace)
    Finally
      If Not (aFileStream Is Nothing) Then aFileStream.Close()
    End Try
  End Sub
  
End Class

   
    
    
  








Related examples in the same category

1.BinaryWriter.Seek
2.BinaryWriter.Write(Double d)
3.BinaryWriter.Write(Integer i)
4.BinaryWriter.Write(String s)