2009-05-24 21 views

risposta

20

Non credo che ci sia un equivalente esatto, ma si potrebbe avere fatto con un BinaryWriter:

http://msdn2.microsoft.com/en-us/library/system.io.binarywriter.aspx

MemoryStream m = new MemoryStream(); 
BinaryWriter writer = new BinaryWriter(m); 
writer.Write(true); 
writer.Write("hello"); 
writer.Write(12345); 
writer.Flush(); 
return m.ToArray(); 
+0

Precisamente ciò di cui avevo bisogno, grazie. – kdt

1

scriverle in un MemoryStream, magari utilizzando uno StreamWriter/BinaryWriter. Se l'endianità è un problema, alcune delle classi here potrebbero essere d'aiuto

Problemi correlati