DataInputStream class Equivalent in C#
Asked Answered
B

2

5

I want to know what is the Java DataInputStream class equivalent in C#

Backlash answered 25/3, 2011 at 8:26 Comment(0)
P
12

You are looking for BinaryReader:

var reader = new BinaryReader(myStream);
var value = reader.ReadInt32();
Photogram answered 25/3, 2011 at 8:37 Comment(0)
L
-2

there's no direct equivalent; but if you want to read data from console input, you can use Console.Read(), Console.ReadKey() or Console.ReadLine()

.NET Console Methods: http://msdn.microsoft.com/en-us/library/yz3fhfz1.aspx

If you want to read data from other sources, use an appropriate object that inherits from the System.IO.Stream class. There's FileStream, MemoryStream, NetworkStream, etc.

Levant answered 25/3, 2011 at 8:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.