csvorbis.VorbisFile.fseek C# (CSharp) Method

fseek() static private method

static private fseek ( FileStream fis, long off, int whence ) : int
fis System.IO.FileStream
off long
whence int
return int
        static int fseek(FileStream fis,
			//int64_t off,
			long off,
			int whence)
        {
            if(fis.CanSeek == true)
            {
                try
                {
                    if(whence==SEEK_SET)
                    {
                        fis.Seek(off, 0);
                    }
                    else if(whence==SEEK_END)
                    {
                        fis.Seek(fis.Length - off, 0);
                    }
                    else
                    {
                        Console.Error.WriteLine("seek: "+whence+" is not supported");
                    }
                }
                catch(Exception e)
                {
                    Console.Error.WriteLine(e.Message);
                }
                return 0;
            }
            try
            {
                if(whence==0){ fis.Seek(0, 0); }
                fis.Seek(off, 0);
            }
            catch(Exception e)
            {
                Console.Error.WriteLine(e.Message);
                return -1;
            }
            return 0;
        }