Logo Search packages:      
Sourcecode: libjlayer-java version File versions  Download package

boolean javazoom::jl::decoder::Bitstream::isSyncCurrentPosition ( int  syncmode  )  throws BitstreamException [inline]

Determines if the next 4 bytes of the stream represent a frame header.

Definition at line 365 of file Bitstream.java.

References readBytes(), and syncword.

      {
            int read = readBytes(syncbuf, 0, 4);
            int headerstring = ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF);

            try
            {
                  source.unread(syncbuf, 0, read);
            }
            catch (IOException ex)
            {
            }

            boolean sync = false;
            switch (read)
            {
                  case 0:
                        sync = true;
                        break;
                  case 4:
                        sync = isSyncMark(headerstring, syncmode, syncword);
                        break;
            }

            return sync;
      }


Generated by  Doxygen 1.6.0   Back to index