Package ipsk.io
Class InterleavedChannelRoutingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- ipsk.io.FramedInputStream
-
- ipsk.io.FramedEditingInputStream
-
- ipsk.io.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
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEBUG
-
Fields inherited from class ipsk.io.FramedEditingInputStream
is
-
Fields inherited from class ipsk.io.FramedInputStream
frameSize, frameSizeException
-
-
Constructor Summary
Constructors Constructor Description InterleavedChannelRoutingInputStream(java.io.InputStream is, int sampleSize, int inputChannelCount, java.lang.Integer[] assignment)
Edits channels
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
int
read(byte[] buf, int offset, int len)
long
skip(long n)
-
Methods inherited from class ipsk.io.FramedEditingInputStream
close
-
Methods inherited from class ipsk.io.FramedInputStream
read, read
-
-
-
-
Field Detail
-
DEBUG
public static final boolean DEBUG
- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public int read(byte[] buf, int offset, int len) throws java.io.IOException
- Specified by:
read
in classFramedInputStream
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.InputStream
- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException
- Overrides:
available
in classjava.io.InputStream
- Throws:
java.io.IOException
-
-