FileDocCategorySizeDatePackage
FileHeader.javaAPI DocJaudiotagger 2.0.47441Wed Mar 30 16:11:50 BST 2011org.jaudiotagger.audio.asf.data

FileHeader

public class FileHeader extends Chunk
This class stores the information about the file, which is contained within a special chunk of ASF files.
author
Christian Laireiter

Fields Summary
private final BigInteger
duration
Duration of the media content in 100ns steps.
private final Date
fileCreationTime
The time the file was created.
private final BigInteger
fileSize
Size of the file or stream.
private final long
flags
Usually contains value of 2.
private final long
maxPackageSize
Maximum size of stream packages.
Warning: must be same size as {@link #minPackageSize}. Its not known how to handle deviating values.
private final long
minPackageSize
Minimun size of stream packages.
Warning: must be same size as {@link #maxPackageSize}. Its not known how to handle deviating values.
private final BigInteger
packageCount
Number of stream packages within the File.
private final BigInteger
timeEndPos
No Idea of the Meaning, but stored anyway.
Source documentation says it is: "Timestamp of end position"
private final BigInteger
timeStartPos
Like {@link #timeEndPos}no Idea.
private final long
uncompressedFrameSize
Size of an uncompressed video frame.
Constructors Summary
public FileHeader(BigInteger chunckLen, BigInteger size, BigInteger fileTime, BigInteger pkgCount, BigInteger dur, BigInteger timestampStart, BigInteger timestampEnd, long headerFlags, long minPkgSize, long maxPkgSize, long uncmpVideoFrameSize)
Creates an instance.

param
chunckLen Length of the file header (chunk)
param
size Size of file or stream
param
fileTime Time file or stream was created. Time is calculated since 1st january of 1601 in 100ns steps.
param
pkgCount Number of stream packages.
param
dur Duration of media clip in 100ns steps
param
timestampStart Timestamp of start {@link #timeStartPos}
param
timestampEnd Timestamp of end {@link #timeEndPos}
param
headerFlags some stream related flags.
param
minPkgSize minimum size of packages
param
maxPkgSize maximum size of packages
param
uncmpVideoFrameSize Size of an uncompressed Video Frame.

        super(GUID.GUID_FILE, chunckLen);
        this.fileSize = size;
        this.packageCount = pkgCount;
        this.duration = dur;
        this.timeStartPos = timestampStart;
        this.timeEndPos = timestampEnd;
        this.flags = headerFlags;
        this.minPackageSize = minPkgSize;
        this.maxPackageSize = maxPkgSize;
        this.uncompressedFrameSize = uncmpVideoFrameSize;
        this.fileCreationTime = Utils.getDateOf(fileTime).getTime();
    
Methods Summary
public java.math.BigIntegergetDuration()

return
Returns the duration.

        return this.duration;
    
public intgetDurationInSeconds()
This method converts {@link #getDuration()}from 100ns steps to normal seconds.

return
Duration of the media in seconds.

        return this.duration.divide(new BigInteger("10000000")).intValue();
    
public java.util.DategetFileCreationTime()

return
Returns the fileCreationTime.

        return new Date(this.fileCreationTime.getTime());
    
public java.math.BigIntegergetFileSize()

return
Returns the fileSize.

        return this.fileSize;
    
public longgetFlags()

return
Returns the flags.

        return this.flags;
    
public longgetMaxPackageSize()

return
Returns the maxPackageSize.

        return this.maxPackageSize;
    
public longgetMinPackageSize()

return
Returns the minPackageSize.

        return this.minPackageSize;
    
public java.math.BigIntegergetPackageCount()

return
Returns the packageCount.

        return this.packageCount;
    
public floatgetPreciseDuration()
This method converts {@link #getDuration()} from 100ns steps to normal seconds with a fractional part taking milliseconds.

return
The duration of the media in seconds (with a precision of milliseconds)

        return (float) (getDuration().doubleValue() / 10000000d);
    
public java.math.BigIntegergetTimeEndPos()

return
Returns the timeEndPos.

        return this.timeEndPos;
    
public java.math.BigIntegergetTimeStartPos()

return
Returns the timeStartPos.

        return this.timeStartPos;
    
public longgetUncompressedFrameSize()

return
Returns the uncompressedFrameSize.

        return this.uncompressedFrameSize;
    
public java.lang.StringprettyPrint(java.lang.String prefix)
(overridden)

see
org.jaudiotagger.audio.asf.data.Chunk#prettyPrint(String)

        final StringBuilder result = new StringBuilder(super.prettyPrint(prefix));
        result.append(prefix).append("  |-> Filesize      = ").append(
                getFileSize().toString()).append(" Bytes").append(
                Utils.LINE_SEPARATOR);
        result.append(prefix).append("  |-> Media duration= ").append(
                getDuration().divide(new BigInteger("10000")).toString())
                .append(" ms").append(Utils.LINE_SEPARATOR);
        result.append(prefix).append("  |-> Created at    = ").append(
                getFileCreationTime()).append(Utils.LINE_SEPARATOR);
        return result.toString();