code: public Metadata readNextMetadata() throws IOException {
          Metadata metadata = null;
          
          boolean isLast = (bitStream.readRawUInt(Metadata.STREAM_METADATA_IS_LAST_LEN) != 0);
          int type = bitStream.readRawUInt(Metadata.STREAM_METADATA_TYPE_LEN);
          int length = bitStream.readRawUInt(Metadata.STREAM_METADATA_LENGTH_LEN);
          
          if (type == Metadata.METADATA_TYPE_STREAMINFO) {
          	metadata = streamInfo = new StreamInfo(bitStream, length, isLast);
              pcmProcessors.processStreamInfo((StreamInfo)metadata);
          } else if (type == Metadata.METADATA_TYPE_SEEKTABLE) {
          	metadata = seekTable = new SeekTable(bitStream, length, isLast);
          } else if (type == Metadata.METADATA_TYPE_APPLICATION) {
              metadata = new Application(bitStream, length, isLast);
          } else if (type == Metadata.METADATA_TYPE_PADDING) {
              metadata = new Padding(bitStream, length, isLast);
          } else if (type == Metadata.METADATA_TYPE_VORBIS_COMMENT) {
              metadata = vorbisComment = new VorbisComment(bitStream, length, isLast);
          } else if (type == Metadata.METADATA_TYPE_CUESHEET) {
  	    metadata = new CueSheet(bitStream, length, isLast);
  	} else if (type == Metadata.METADATA_TYPE_PICTURE) {
  	    metadata = new Picture(bitStream, length, isLast);
          } else {
              metadata = new Unknown(bitStream, length, isLast);
          }
          frameListeners.processMetadata(metadata);
          //if (isLast) state = DECODER_SEARCH_FOR_FRAME_SYNC;
          return metadata;
      }
docs: Read a single metadata record.
  @return  The next metadata record
  @throws IOException  on read error