views:

35

answers:

0

I'm trying to create a subclass of StreamWriter to write .CSV files, where no linebreaks are allowed in the fields. Amongst other things i replace the newline character and delimit stuff.

This goes fairly well untill I try to end a line.

I don't override or shadow StreamWriter.writeLine()

As soon as I call writer.WriteLine() I end up in my own code:

Public Overrides Sub Write(ByVal buffer() As Char)
    Write(New String(buffer))
End Sub

Now that was not the behaviour I was looking for, because now my subclass handles the Write(byVal string as String) call, and replaces the newline character. What I want is the base class to completely handle the WriteLine() call, and not delegate anything back. How can I accomplish such behaviour?

I tried with

Public Overrides Sub WriteLine()
    MyBase.WriteLine()
End Sub

to no avail.