public static WavHeaderInfo parseHeader(byte[] data, int offset, int len) {
        try {
            WavHeaderInfo instance = new WavHeaderInfo();
            if (BaseChunk.isChunkIDEuqal(data, offset, RIFF_Chunk.CONST_CHUNK_ID, 0)) {
                instance.mRiffChunk = RIFF_Chunk.create(data, offset, len);
                offset += 12;
            } else {
                throw new FormatNotSupportedException("no RIFF chunk");
            }

            while (true) {
                if (BaseChunk.isChunkIDEuqal(data, offset,
                        FMT_Chunk.CONST_CHUNK_ID, 0)) {
                    instance.mFmtChunk = FMT_Chunk.create(data, offset, len - offset);
                    offset += instance.mFmtChunk.getChunkSize();
                } else if (BaseChunk.isChunkIDEuqal(
                        data, offset, DATA_Chunk.CONST_CHUNK_ID, 0)) {
                    instance.mDataChunk = DATA_Chunk.create(data, offset, len - offset);
                    break;
                } else {
                    Unknown_Chunk un = Unknown_Chunk.create(data, offset, len - offset);
                    offset += un.getChunkSize();
                    instance.mUnknownChunkList.add(un);
                }
            }

            if (instance.mFmtChunk == null) {
                throw new FormatNotSupportedException("no FMT chunk");
            }
            if (instance.mDataChunk == null) {
                throw new FormatNotSupportedException("no Data chunk");
            }
            return instance;
        } catch (ArrayIndexOutOfBoundsException e) {
            return null;
        } catch (FormatNotSupportedException fe) {
            return null;
        }
    }