CSKernelFile.cFile.binaryRead C# (CSharp) Method

binaryRead() public method

public binaryRead ( byte &buffer, bool &eof ) : bool
buffer byte
eof bool
return bool
        public bool binaryRead(out byte[] buffer, out bool eof)
        {
            buffer = null;
            eof = false;
            if (!m_open) return false;
            try
            {
                if (isEof)
                {
                    eof = true;
                    buffer = null;
                }
                else
                {
                    long bytesInFile = m_file.Length - m_file.Position;
                    if (bytesInFile < buffer.Length)
                    {
                        buffer = new byte[bytesInFile];
                    }
                    buffer = m_br.ReadBytes(buffer.Length);
                }
                return true;
            }
            catch (Exception ex)
            {
                cError.mngError(ex, "binaryRead", c_module, "failed reading in binary mode from file: " + m_path + Path.DirectorySeparatorChar + m_name);
                return false;
            }
        }