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

ByteVector TagLib::File::ReadBlock ( int  length  )  [inline, inherited]

Reads a specified number of bytes at the current seek position from the current instance.

Parameters:
length A int value specifying the number of bytes to read.
Returns:
A ByteVector object containing the data read from the current instance.

This method reads the block of data at the current seek position. To change the seek position, use Seek(long,System.IO.SeekOrigin).

Exceptions:
ArgumentException length is less than zero.

Definition at line 639 of file File.cs.

References TagLib::File::file_stream, and TagLib::File::Mode.

Referenced by TagLib::Riff::DivXTag::DivXTag(), TagLib::File::Find(), TagLib::Mpeg::File::GetMarker(), TagLib::File::Insert(), TagLib::Ogg::Page::OverwriteSequenceNumbers(), TagLib::Ogg::Page::Page(), TagLib::Ogg::PageHeader::PageHeader(), TagLib::Id3v2::Tag::Read(), TagLib::Riff::File::Read(), TagLib::Aiff::File::Read(), TagLib::Tiff::Cr2::File::ReadAdditionalCR2Header(), TagLib::Tiff::Rw2::File::ReadAdditionalRW2Header(), TagLib::Jpeg::File::ReadAPP1Segment(), TagLib::Gif::File::ReadApplicationExtensionBlock(), TagLib::Mpeg::File::ReadAudioPacket(), TagLib::Flac::File::ReadBlocks(), TagLib::Gif::File::ReadByte(), TagLib::Png::File::ReadChunkData(), TagLib::Png::File::ReadChunkLength(), TagLib::Png::File::ReadChunkType(), TagLib::Jpeg::File::ReadCOMSegment(), TagLib::Png::File::ReadCRC(), TagLib::Jpeg::File::ReadDQTSegment(), TagLib::Asf::File::ReadDWord(), TagLib::Asf::File::ReadGuid(), TagLib::Gif::File::ReadHeader(), TagLib::Jpeg::File::ReadJFIFHeader(), TagLib::Asf::File::ReadQWord(), TagLib::Jpeg::File::ReadSegmentMarker(), TagLib::Jpeg::File::ReadSegmentSize(), TagLib::Jpeg::File::ReadSOFSegment(), ReadStart(), TagLib::MusePack::File::ReadStart(), TagLib::Ape::File::ReadStart(), TagLib::Gif::File::ReadSubBlocks(), TagLib::Mpeg::File::ReadSystemFile(), TagLib::Mpeg::File::ReadSystemSyncPacket(), TagLib::Mpeg::File::ReadTimestamp(), TagLib::Asf::File::ReadUnicode(), TagLib::Mpeg::File::ReadVideoPacket(), TagLib::Asf::File::ReadWord(), TagLib::File::RemoveBlock(), TagLib::File::RFind(), TagLib::Gif::File::SkipColorTable(), TagLib::Gif::File::SkipImage(), TagLib::Id3v1::Tag::Tag(), TagLib::Png::File::ValidateHeader(), and TagLib::Jpeg::File::ValidateHeader().

            {
                  if (length < 0)
                        throw new ArgumentException (
                              "Length must be non-negative",
                              "length");
                  
                  if (length == 0)
                        return new ByteVector ();
                  
                  Mode = AccessMode.Read;
                  
                  byte [] buffer = new byte [length];
                  int count = file_stream.Read (buffer, 0, length);
                  return new ByteVector (buffer, count);
            }


Generated by  Doxygen 1.6.0   Back to index