org.tritonus.share.sampled.file
Class TAudioOutputStream

java.lang.Object
  extended by org.tritonus.share.sampled.file.TAudioOutputStream
All Implemented Interfaces:
AudioOutputStream
Direct Known Subclasses:
AiffAudioOutputStream, AuAudioOutputStream, HeaderlessAudioOutputStream, WaveAudioOutputStream

public abstract class TAudioOutputStream
extends java.lang.Object
implements AudioOutputStream

Base class for classes implementing AudioOutputStream.


Method Summary
 void close()
          Closes the stream.
 long getCalculatedLength()
          Gives number of bytes already written.
 AudioFormat getFormat()
          Retrieves the AufioFormat of this AudioOutputStream.
 long getLength()
          Gives length of the stream.
 int write(byte[] abData, int nOffset, int nLength)
          Writes audio data to the destination (file or output stream).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFormat

public AudioFormat getFormat()
Description copied from interface: AudioOutputStream
Retrieves the AufioFormat of this AudioOutputStream.

Specified by:
getFormat in interface AudioOutputStream

getLength

public long getLength()
Gives length of the stream. This value is in bytes. It may be AudioSystem.NOT_SPECIFIED to express that the length is unknown.

Specified by:
getLength in interface AudioOutputStream

getCalculatedLength

public long getCalculatedLength()
Gives number of bytes already written.


write

public int write(byte[] abData,
                 int nOffset,
                 int nLength)
          throws java.io.IOException
Writes audio data to the destination (file or output stream).

Specified by:
write in interface AudioOutputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the stream. This does write remaining buffered data to the destination, backpatch the header, if necessary, and closes the destination.

Specified by:
close in interface AudioOutputStream
Throws:
java.io.IOException