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

ByteVector TagLib::ByteVector::Mid ( int  startIndex,
int  length 
) [inline, inherited]

Creates a new instance of ByteVector containing a specified range of elements from the current instance.

Parameters:
startIndex A int value specifying the index at which to start copying elements from the current instance.
length A int value specifying the number of elements to copy from the current instance.
Exceptions:
ArgumentOutOfRangeException startIndex is less than zero or greater than or equal to Count. OR length is less than zero or greater than the amount of available data.

Definition at line 432 of file ByteVector.cs.

References TagLib::ByteVector::ByteVector(), TagLib::ByteVector::Count, and TagLib::ByteVector::data.

Referenced by TagLib::Mpeg4::AppleElementaryStreamDescriptor::AppleElementaryStreamDescriptor(), TagLib::Riff::AviHeader::AviHeader(), TagLib::Riff::AviStreamHeader::AviStreamHeader(), TagLib::Riff::BitmapInfoHeader::BitmapInfoHeader(), TagLib::Flac::BlockHeader::BlockHeader(), TagLib::Mpeg4::BoxHeader::BoxHeader(), TagLib::Id3v2::FrameFactory::CreateFrame(), TagLib::IFD::IFDReader::CreateIFDEntry(), TagLib::Id3v2::Frame::FieldData(), TagLib::Mpeg::AudioHeader::Find(), TagLib::Aac::AudioHeader::Find(), TagLib::IFD::IFDReader::FixupDirectory(), TagLib::Id3v2::Footer::Footer(), TagLib::Ape::Footer::Footer(), TagLib::Id3v2::FrameHeader::FrameHeader(), TagLib::Mpeg4::FullBox::FullBox(), TagLib::Id3v2::Header::Header(), TagLib::Mpeg4::IsoChunkLargeOffsetBox::IsoChunkLargeOffsetBox(), TagLib::Mpeg4::IsoChunkOffsetBox::IsoChunkOffsetBox(), TagLib::Mpeg4::IsoHandlerBox::IsoHandlerBox(), TagLib::Mpeg4::IsoMovieHeaderBox::IsoMovieHeaderBox(), TagLib::ByteVector::Mid(), TagLib::Ogg::PageHeader::PageHeader(), TagLib::Riff::List< TagLib::ICodec >::Parse(), TagLib::Riff::DivXTag::Parse(), TagLib::Ogg::XiphComment::Parse(), TagLib::Id3v2::ExtendedHeader::Parse(), TagLib::Id3v1::Tag::Parse(), TagLib::Ape::Item::Parse(), TagLib::Id3v2::SynchronisedLyricsFrame::ParseFields(), TagLib::Id3v2::RelativeVolumeFrame::ParseFields(), TagLib::Id3v2::PopularimeterFrame::ParseFields(), TagLib::Id3v2::TextInformationFrame::ParseRawData(), TagLib::Riff::AviStream::ParseStreamList(), TagLib::Flac::Picture::Picture(), TagLib::Asf::Tag::PictureFromData(), TagLib::Tiff::Cr2::File::ReadAdditionalCR2Header(), TagLib::Jpeg::File::ReadAPP1Segment(), TagLib::Gif::File::ReadApplicationExtensionBlock(), TagLib::Jpeg::File::ReadCOMSegment(), TagLib::Tiff::BaseTiffFile::ReadHeader(), TagLib::Gif::File::ReadHeader(), TagLib::IFD::IFDReader::ReadIFD(), TagLib::Png::File::ReadIHDRChunk(), TagLib::Png::File::ReadiTXtChunk(), TagLib::Ogg::Codecs::Vorbis::ReadPacket(), TagLib::Ogg::Codecs::Theora::ReadPacket(), TagLib::NonContainer::EndTag::ReadTagInfo(), TagLib::Png::File::ReadTerminatedString(), TagLib::Png::File::ReadtEXtChunk(), TagLib::Png::File::ReadzTXtChunk(), TagLib::Gif::File::RenderGifCommentBlock(), TagLib::ByteVectorCollection::Split(), TagLib::WavPack::StreamHeader::StreamHeader(), TagLib::MusePack::StreamHeader::StreamHeader(), TagLib::Flac::StreamHeader::StreamHeader(), TagLib::Ape::StreamHeader::StreamHeader(), TagLib::Aiff::StreamHeader::StreamHeader(), TagLib::Id3v2::Tag::Tag(), TagLib::Ape::Tag::Tag(), TagLib::ByteVector::ToString(), TagLib::Mpeg::VBRIHeader::VBRIHeader(), TagLib::Mpeg::VideoHeader::VideoHeader(), TagLib::Riff::WaveFormatEx::WaveFormatEx(), and TagLib::Mpeg::XingHeader::XingHeader().

            {
                  if (startIndex < 0 || startIndex > Count)
                        throw new ArgumentOutOfRangeException (
                              "startIndex");
                  
                  if (length < 0 || startIndex + length > Count)
                        throw new ArgumentOutOfRangeException (
                              "length");
                  
                  if (length == 0)
                        return new ByteVector ();
                        
                  if(startIndex + length > this.data.Count)
                        length = this.data.Count - startIndex;
                  
                  byte [] data = new byte [length];
                  
                  this.data.CopyTo (startIndex, data, 0, length);
                  
                  return data;
            }


Generated by  Doxygen 1.6.0   Back to index