Skip to content

Instantly share code, notes, and snippets.

@mkrueger
Created June 2, 2015 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkrueger/bf56417461fff05e98b6 to your computer and use it in GitHub Desktop.
Save mkrueger/bf56417461fff05e98b6 to your computer and use it in GitHub Desktop.
private static long GetPrivateOffset (MemoryMappedViewAccessor stream)
{
object value = typeof(MemoryMappedViewAccessor).GetField ("m_view", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField).GetValue (stream);
return (long)value.GetType ().GetProperty ("PointerOffset", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetProperty).GetValue (value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment