Pchp.Library.Streams.NativeStream.RawRead C# (CSharp) Method

RawRead() protected method

protected RawRead ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
return int
        protected override int RawRead(byte[] buffer, int offset, int count)
        {
            try
            {
                int read = stream.Read(buffer, offset, count);
                if (read == 0) reportEof = true;
                return read;
            }
            catch (NotSupportedException)
            {
                PhpException.Throw(PhpError.Warning, ErrResources.wrapper_op_unsupported, "Read");
                return -1;
            }
            catch (IOException e)
            {
                PhpException.Throw(PhpError.Warning, ErrResources.stream_read_io_error, e.Message);
                return -1;
            }
            catch (System.Exception e)
            {
                // For example WebException (timeout)
                PhpException.Throw(PhpError.Warning, ErrResources.stream_read_error, e.Message);
                return -1;
            }
        }