Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a C# equivalent way for Java InputStream and OutputStream?

Tags:

java

c#

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?

like image 845
Xris Avatar asked Nov 14 '11 09:11

Xris


People also ask

Why is there a slash in AC?

Senior Member. You read it as "ei-cee" (no "slash" pronounced). In terms of distinguishing between "air conditioning" and "air conditioner," I can think of an example like "Today, I bought a new air conditioner" ("conditioning" not allowed). I personally would not say "Today, I bought a new AC."

Why is it called AC?

Air conditioning, often abbreviated as A/C or AC, is the process of removing heat from an enclosed space to achieve a more comfortable interior environment (sometimes referred to as 'comfort cooling') and in some cases also strictly controlling the humidity of internal air.

Is AC the same as AC?

In the air conditioning industry, the term HVAC is often used instead of AC. HVAC refers to heating, ventilation, and air conditioning, whereas AC simply refers to air conditioning. AC is generally used when referring to systems that are designed to cool the air in your home.

What are a C units called?

What A/C Means. The term “A/C” stands for “air conditioning,” but it's frequently used to describe any type of home cooling equipment, such as a traditional split-system air conditioner or heat pump, mini-split unit, geothermal system, or even a window unit.


2 Answers

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.

like image 159
Florian Greinacher Avatar answered Oct 13 '22 00:10

Florian Greinacher


You can use StreamWriter and StreamReader classes.

  • StreamReader: Implements a TextReader that reads characters from a byte stream in a particular encoding
  • StreamWriter: Implements a TextWriter for writing characters to a stream in a particular encoding.
like image 40
Dmitry Kruglov Avatar answered Oct 12 '22 22:10

Dmitry Kruglov