com.coremedia.iso
Class IsoOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by com.coremedia.iso.IsoOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class IsoOutputStream
extends FilterOutputStream

An output stream for easy writing of ISO boxes. May calculate DCF hashes.


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
IsoOutputStream(OutputStream os)
           
IsoOutputStream(OutputStream os, boolean calculateHash)
           
 
Method Summary
 byte[] getHash()
           
 long getStreamPosition()
           
 void startHashCalculation()
          Hash calculation is activated by default.
 void stopHashCalculation()
          Hash calculation is activated by default.
 void write(byte[] b)
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeFixedPont1616(double v)
           
 void writeFixedPont88(double v)
           
 void writeIso639(String language)
           
 void writeStringNoTerm(String str)
           
 void writeStringZeroTerm(String str)
           
 void writeUInt16(int uint16)
           
 void writeUInt16BE(int uint16)
           
 void writeUInt24(int uint24)
           
 void writeUInt32(long uint32)
           
 void writeUInt32BE(long uint32)
           
 void writeUInt64(long uint64)
           
 void writeUInt8(int uint8)
           
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsoOutputStream

public IsoOutputStream(OutputStream os,
                       boolean calculateHash)

IsoOutputStream

public IsoOutputStream(OutputStream os)
Method Detail

stopHashCalculation

public void stopHashCalculation()
Hash calculation is activated by default. Boxes that are not used to calculate the hash ('mdri' and children) will call this before writing and will call startHashCalculation() afterwards.


startHashCalculation

public void startHashCalculation()
Hash calculation is activated by default. Boxes that are not used to calculate the hash ('mdri' and children) will call stopHashCalculation() before writing and will call this method afterwards.


getStreamPosition

public long getStreamPosition()

writeUInt64

public void writeUInt64(long uint64)
                 throws IOException
Throws:
IOException

writeUInt32

public void writeUInt32(long uint32)
                 throws IOException
Throws:
IOException

writeUInt24

public void writeUInt24(int uint24)
                 throws IOException
Throws:
IOException

writeUInt16

public void writeUInt16(int uint16)
                 throws IOException
Throws:
IOException

writeUInt8

public void writeUInt8(int uint8)
                throws IOException
Throws:
IOException

write

public void write(int b)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

write

public void write(byte[] b)
           throws IOException
Overrides:
write in class FilterOutputStream
Throws:
IOException

writeStringZeroTerm

public void writeStringZeroTerm(String str)
                         throws IOException
Throws:
IOException

writeStringNoTerm

public void writeStringNoTerm(String str)
                       throws IOException
Throws:
IOException

writeIso639

public void writeIso639(String language)
                 throws IOException
Throws:
IOException

writeFixedPont1616

public void writeFixedPont1616(double v)
                        throws IOException
Throws:
IOException

writeFixedPont88

public void writeFixedPont88(double v)
                      throws IOException
Throws:
IOException

getHash

public byte[] getHash()

writeUInt32BE

public void writeUInt32BE(long uint32)
                   throws IOException
Throws:
IOException

writeUInt16BE

public void writeUInt16BE(int uint16)
                   throws IOException
Throws:
IOException


Copyright © 2011. All Rights Reserved.