csvorbis.VorbisFile.open_callbacks C# (CSharp) Method

open_callbacks() private method

private open_callbacks ( FileStream iis, byte initial, int ibytes ) : int
iis System.IO.FileStream
initial byte
ibytes int
return int
        int open_callbacks(FileStream iis, byte[] initial, int ibytes)
        {
            int ret;
            datasource=iis;
            //callbacks = _callbacks;
            // init the framing state
            oy.init();

            // perhaps some data was previously read into a buffer for testing
            // against other stream types.  Allow initialization from this
            // previously read data (as we may be reading from a non-seekable
            // stream)
            if(initial!=null)
            {
                int index=oy.buffer(ibytes);
                Array.Copy(initial, 0, oy.data, index, ibytes);
                oy.wrote(ibytes);
            }
            // can we seek? Stevens suggests the seek test was portable
            if(iis.CanSeek == true){ ret=open_seekable(); }
            else{ ret=open_nonseekable(); }
            if(ret!=0)
            {
                datasource=null;
                clear();
            }
            return(ret);
        }