Class AuChannelStreamLine

All Implemented Interfaces:
AutoCloseable, DataLine, Line, SourceDataLine

public class AuChannelStreamLine extends ChannelStreamLine
Channel stream line for Au (simple audio) encoding.
  • Constructor Details

    • AuChannelStreamLine

      public AuChannelStreamLine(WritableByteChannel bc, AudioFormat format, long writeAheadMillis, long timeoutMillis, int bufferSamples) throws LineUnavailableException, UnsupportedAudioFileException
      Creates a line for streaming in Au format to a channel.
      Parameters:
      bc - the channel to stream to, which must be non-blocking
      format - audio format of the PCM data written to this line
      writeAheadMillis - limit for how much to write ahead of what receiver has played, Long.MAX_VALUE for unlimited
      timeoutMillis - time to wait when when write-ahead limit is reached
      bufferSamples - size of line buffer in number of sample frames
      Throws:
      LineUnavailableException
      UnsupportedAudioFileException
  • Method Details

    • write

      public int write(byte[] b, int off, int len)
    • bufferedSamples

      protected int bufferedSamples()
      Description copied from class: ChannelStreamLine
      Number of bytes received by the line but not yet sent to the channel.
      Specified by:
      bufferedSamples in class ChannelStreamLine
    • writeBuffer

      protected void writeBuffer() throws IOException
      Description copied from class: ChannelStreamLine
      Writes data buffered on the line to the channel.
      Specified by:
      writeBuffer in class ChannelStreamLine
      Throws:
      IOException
    • flush

      public void flush()
      Discards buffered data that has not yet been written to the channel.
    • getBufferSize

      public int getBufferSize()
    • available

      public int available()