2010-07-23 92 views
3

什么是C fread()的C#模拟?C fread()的C#模拟是什么?

C code here we use

fread(inbuf, 1, AUDIO_INBUF_SIZE, f); 

可能是什么它的准确模拟?

+0

二进制格式 - http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatters。 binary.binaryformatter.aspx? – Noldorin 2010-07-23 13:33:35

+1

试试'LagThenLagSomeMore'函数。 :) – 2010-07-23 13:34:04

回答

6

最接近的将是Stream.Read

byte[] buffer = new byte[8192]; 
int bytesRead = stream.Read(buffer, 0, buffer.Length);