public int GetBinary([ComAliasName("OLE.LPCOLESTR")] string collectionPath, [ComAliasName("OLE.LPCOLESTR")] string propertyName, [ComAliasName("OLE.ULONG")] uint byteLength, [ComAliasName("TextManager.BYTE")] byte[] pBytes, [ComAliasName("OLE.ULONG")] uint[] actualByteLength) { var stream = inner.GetMemoryStream(collectionPath, propertyName); if (byteLength == 0 || pBytes == null) { actualByteLength[0] = (uint)stream.Length; } else { stream.CopyTo(new MemoryStream(pBytes, 0, (int)byteLength)); } return(0); }