Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Untitled
SUBMITTED BY:
Guest
DATE:
Aug. 4, 2017, 12:10 p.m.
FORMAT:
Text only
SIZE:
867 Bytes
Raw
Download
Tweet
HITS:
265
Go to comments
Report
public static void Write(int arg, int offset, byte[] buffer)
{
if (buffer == null)
{
return;
}
if (offset > buffer.Length - 1)
{
return;
}
if (buffer.Length >= offset + sizeof(uint))
{
unsafe
{
#if UNSAFE
fixed (byte* Buffer = buffer)
{
*((int*)(Buffer + offset)) = arg;
}
#else
buffer[offset] = (byte)(arg);
buffer[offset + 1] = (byte)(arg >> 8);
buffer[offset + 2] = (byte)(arg >> 16);
buffer[offset + 3] = (byte)(arg >> 24);
#endif
}
}
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus