/*
* Now reading header of chuncks.
*/
ArrayList chunks = new ArrayList();
while (chunkLen.compareTo(BigInteger.valueOf(in.getFilePointer())) > 0) {
Chunk chunk = ChunkHeaderReader.readChunckHeader(in);
chunks.add(chunk);
in.seek(chunk.getChunckEnd());
}
/*
* Creating the resulting object because streamchunks will be added.
*/
result = new AsfHeader(chunkStart, chunkLen, chunkCount);
/*
* Now we know all positions and guids of chunks which are contained
* whithin asf header. Further we need to identify the type of those
* chunks and parse the interesting ones.
*/
FileHeader fileHeader = null;
ExtendedContentDescription extendedDescription = null;
EncodingChunk encodingChunk = null;
StreamChunk streamChunk = null;
ContentDescription contentDescription = null;
StreamBitratePropertiesChunk bitratePropertiesChunk = null;
Iterator iterator = chunks.iterator();
while (iterator.hasNext()) {
Chunk currentChunk = (Chunk) iterator.next();
if (fileHeader == null
&& (fileHeader = FileHeaderReader
.read(in, currentChunk)) != null) {
continue;
}