Package ipsk.io

Class InterleavedChannelRoutingInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class InterleavedChannelRoutingInputStream
    extends FramedEditingInputStream
    Edits channels (interleaved data) from underlying stream. The stream must have an interleaved channel format, for example frameSize=8 bytes, channels=4 (samplesize=2 bytes): fr0ch0sb0,fr0ch0sb1,fr0ch1sb0,fr0ch1sb1,fr0ch2sb0,fr0ch2sb1,fr0ch3sb0,fr0ch3sb1,fr1ch0sb0,fr1ch0sb1,fr1ch1sb0,fr1ch1sb1,fr1ch2sb0,fr1ch2sb1,fr1ch3sb0,fr1ch3sb1 fr: frame ch: channel sb: byte of sample A assignment array of {1,3} edits the stream to: fr0ch1sb0,fr0ch1sb1,fr0ch3sb0,fr0ch3sb1,fr1ch1sb0,fr1ch1sb1,fr1ch3sb0,fr1ch3sb1 The resulting stream has two channels.
    Author:
    K.Jaensch, klausj@phonetik.uni-muenchen.de
    • Constructor Detail

      • InterleavedChannelRoutingInputStream

        public InterleavedChannelRoutingInputStream​(java.io.InputStream is,
                                                    int sampleSize,
                                                    int inputChannelCount,
                                                    java.lang.Integer[] assignment)
        Edits channels
    • Method Detail

      • read

        public int read​(byte[] buf,
                        int offset,
                        int len)
                 throws java.io.IOException
        Specified by:
        read in class FramedInputStream
        Throws:
        java.io.IOException
      • skip

        public long skip​(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException
      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException