Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

TagLib::Riff::DivXTag::DivXTag ( File  file,
long  position 
) [inline]

Constructs and initializes a new instance of DivXTag by reading the contents from a specified position in a specified file.

file A File object containing the file from which the contents of the new instance is to be read.
position A long value specify at what position to read the tag.
ArgumentNullException file is .
ArgumentOutOfRangeException position is less than zero or greater than the size of the file.
CorruptFileException The file does not contain the file identifier at the correct offset from the given position.

Definition at line 130 of file DivXTag.cs.

References TagLib::ByteVector::EndsWith(), TagLib::File::Length, TagLib::File::Mode, TagLib::File::ReadBlock(), and TagLib::File::Seek().

                  if (file == null)
                        throw new ArgumentNullException ("file");
                  file.Mode = TagLib.File.AccessMode.Read;
                  if (position < 0 ||
                        position > file.Length - Size)
                        throw new ArgumentOutOfRangeException (
                  file.Seek (position);
                  // read the tag -- always 128 bytes
                  ByteVector data = file.ReadBlock ((int) Size);
                  // some initial sanity checking
                  if (!data.EndsWith (FileIdentifier))
                        throw new CorruptFileException (
                              "DivX tag data does not end with identifier.");
                  Parse (data);

Generated by  Doxygen 1.6.0   Back to index