Logo Search packages:      
Sourcecode: jampal version File versions  Download package

byte [] pgbennett::id3::ID3v2Frames::getBytes (  ) [inline]

Return an array bytes containing all frames contained in this object. This can be used to easily write the frames to a file. Empty frames are dropped to save space.

Returns:
an array of bytes contain all frames contained in this object

Definition at line 507 of file ID3v2Frames.java.

References pgbennett::id3::ID3v2Frame::getFrameBytes(), pgbennett::id3::ID3v2Frame::getFrameLength(), getLength(), and pgbennett::id3::ID3v2Frame::isEmpty().

Referenced by pgbennett::id3::ID3v2Tag::getBytes().

                           {
    byte b[] = new byte[getLength()];
    int bytesCopied = 0;

    Iterator it = this.values().iterator();
    while (it.hasNext()) {
      ID3v2Frame frame = (ID3v2Frame) it.next();

      if (!frame.isEmpty()) {
        System.arraycopy(frame.getFrameBytes(), 0, b, bytesCopied,
          frame.getFrameLength());
        bytesCopied += frame.getFrameLength();
      }
    }

    return b;
  }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index