Package entagged.audioformats.asf.data

Examples of entagged.audioformats.asf.data.Chunk


  public static Chunk readChunckHeader(RandomAccessFile input)
      throws IOException {
    long pos = input.getFilePointer();
    GUID guid = Utils.readGUID(input);
    BigInteger chunkLength = Utils.readBig64(input);
    return new Chunk(guid, pos, chunkLength);
  }
View Full Code Here


        // Create byte[] for the asf file.
        byte[] asfContent = description.getBytes();
        // write content
        rafTemp.write(asfContent);
        // Create chunk information
        return new Chunk(GUID.GUID_CONTENTDESCRIPTION, chunkStart, BigInteger
                .valueOf(asfContent.length));
    }
View Full Code Here

         * Now perform the creation of the extended content description
         */
        byte[] asfBytes = tagChunk.getBytes();
        rafTemp.write(asfBytes);

        return new Chunk(GUID.GUID_EXTENDED_CONTENT_DESCRIPTION, chunkStart,
                BigInteger.valueOf(asfBytes.length));
    }
View Full Code Here

      /*
       * 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;
        }
View Full Code Here

   * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
   */
  public int compare(Object o1, Object o2) {
    int result = 0;
    if (o1 instanceof Chunk && o2 instanceof Chunk) {
      Chunk c1 = (Chunk) o1;
      Chunk c2 = (Chunk) o2;
      result = (int) (c1.getPosition() - c2.getPosition());
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of entagged.audioformats.asf.data.Chunk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.