Exemple #1
0
        private static int FPDF_GetBlock(IntPtr param, uint position, IntPtr buffer, uint size)
        {
            var stream = StreamManager.Get((int)param);

            if (stream == null)
            {
                return(0);
            }
            byte[] managedBuffer = new byte[size];

            stream.Position = position;
            int read = stream.Read(managedBuffer, 0, (int)size);

            if (read != size)
            {
                return(0);
            }

            Marshal.Copy(managedBuffer, 0, buffer, (int)size);
            return(1);
        }