Last active
August 29, 2015 14:08
-
-
Save wislon/21af31935e293e325dca to your computer and use it in GitHub Desktop.
Write int32 to binary file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*stick this in linqpad and then open the resulting file in a hex editor (or sublime text)*/ | |
Int32 bob = 640036; | |
using (var fs = new FileStream("d:\\temp.dat", FileMode.Create, FileAccess.ReadWrite)) | |
{ | |
var br = new BinaryWriter(fs); | |
br.Write(bob); // writes out 24 c4 09 00 | |
fs.Flush(); | |
fs.Close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment