15

I am referring to the source code written in java and it contains InputStream and OutputStream objects throughout, i wonder if there is a way in C# to create user-predifined InputStream and Outpustream Classes ; if not the java InputStream and OutputStream objects will they have the same functionality if i treat them as a simple Stream object?

1
  • See this implementation.
    – abhinav
    Nov 14, 2011 at 9:42

1 Answer 1

17

There is no type-level distinction between in- and out-streams in .NET. Just derive your custom class from System.IO.Stream and let the overridden properties CanRead and CanWrite return the appropriate values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.