Exemplo n.º 1
0
            public VfsUdfReader(Stream data)
                : base(null)
            {
                _data = data;

                if (!UdfReader.Detect(data))
                {
                    throw new InvalidDataException("Stream is not a recognized UDF format");
                }

                // Try a number of possible sector sizes, from most common.
                if (ProbeSectorSize(2048))
                {
                    _sectorSize = 2048;
                }
                else if (ProbeSectorSize(512))
                {
                    _sectorSize = 512;
                }
                else if (ProbeSectorSize(4096))
                {
                    _sectorSize = 4096;
                }
                else if (ProbeSectorSize(1024))
                {
                    _sectorSize = 1024;
                }
                else
                {
                    throw new InvalidDataException("Unable to detect physical media sector size");
                }

                Initialize();
            }
Exemplo n.º 2
0
            public VfsUdfReader(Stream data, int sectorSize)
                : base(null)
            {
                _data       = data;
                _sectorSize = (uint)sectorSize;

                if (!UdfReader.Detect(data))
                {
                    throw new InvalidDataException("Stream is not a recognized UDF format");
                }

                Initialize();
            }