Package ipsk.io
Class InsertInputStream
- java.lang.Object
-
- java.io.InputStream
-
- ipsk.io.FramedInputStream
-
- ipsk.io.FramedEditingInputStream
-
- ipsk.io.InsertInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class InsertInputStream extends FramedEditingInputStream
Inserts another input stream in this stream.- Author:
- K.Jaensch, klausj@phonetik.uni-muenchen.de
-
-
Field Summary
-
Fields inherited from class ipsk.io.FramedEditingInputStream
is
-
Fields inherited from class ipsk.io.FramedInputStream
frameSize, frameSizeException
-
-
Constructor Summary
Constructors Constructor Description InsertInputStream(java.io.InputStream is, java.io.InputStream insert, int frameSize, long at)Creates inserting InputStream.InsertInputStream(java.io.InputStream is, java.io.InputStream insert, long at)Insert stream insert to on stream is at the given position using framesize 1.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()intread()intread(byte[] buf, int offset, int len)longskip(long n)-
Methods inherited from class ipsk.io.FramedInputStream
read
-
-
-
-
Constructor Detail
-
InsertInputStream
public InsertInputStream(java.io.InputStream is, java.io.InputStream insert, long at)Insert stream insert to on stream is at the given position using framesize 1.
-
InsertInputStream
public InsertInputStream(java.io.InputStream is, java.io.InputStream insert, int frameSize, long at)Creates inserting InputStream. At the given position the stream is inserted. First the bytes from the source stream are read until the given insert position is reached. Next the insert stream is read until its end. At least the rest of the source stream is read.- Parameters:
is- the underlying (source) InputStreaminsert- the inserted input streamframeSize- size of the data framesat- position where the insert stream is inserted in the source stream
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Overrides:
readin classFramedInputStream- Throws:
java.io.IOException
-
read
public int read(byte[] buf, int offset, int len) throws java.io.IOException- Specified by:
readin classFramedInputStream- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classFramedEditingInputStream- Throws:
java.io.IOException
-
-