Exemple #1
0
        public string Read(byte[] buffer, int size = 512)
        {
            var str = Marshal.PtrToStringAnsi(MagicNative.magic_buffer(_magic, buffer, size));

            if (str == null)
            {
                throw new MagicException(LastError);
            }
            return(str);
        }
Exemple #2
0
        public string Read(byte[] buffer, int bufferSize)
        {
            ThrowIfDisposed();

            var str = Marshal.PtrToStringAnsi(MagicNative.magic_buffer(_magic, buffer, bufferSize));

            if (str == null)
            {
                throw new MagicException(LastError);
            }

            return(str);
        }