|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
mediautil.gen.directio.InStreamFromIterativeWriter
public class InStreamFromIterativeWriter
This class enables reading off directly from an IterativeWriter. The read/skip calls to this class which is to be used as an InputStream translate into nextWrite() calls on the underlying IterativeWriter. Excess bytes written are buffered for the next read call.
Another possible use of this class is in converting an IterativeWriter processing data from an input into a FilterInputStream.
IterativeWriter| Constructor Summary | |
|---|---|
InStreamFromIterativeWriter()
Creates an InStreamFromIterativeWriter Object. |
|
InStreamFromIterativeWriter(int bufSize)
Creates an InStreamFromIterativeWriter Object. |
|
InStreamFromIterativeWriter(int bufSize,
int incSize,
int minWriteSize,
int writeCushion)
Creates an InStreamFromIterativeWriter Object. |
|
| Method Summary | |
|---|---|
int |
available()
Available method of the SplitInputStream. |
int |
getMaxBufSize()
Returns the max bufSize. |
OutputStream |
getWriterOutputStream()
Gets the OutputStream for use by the IterativeWriter. |
int |
read()
Read method of the InStreamFromIterativeWriter. |
int |
read(byte[] b,
int off,
int len)
Read method of the InStreamFromIterativeWriter. |
void |
setIterativeWriter(IterativeWriter iterativeWriter)
Sets the IterativeWriter for this InStreamFromIterativeWriter. |
long |
skip(long n)
Skip method of the InStreamFromIterativeWriter. |
| Methods inherited from class java.io.InputStream |
|---|
close, mark, markSupported, read, reset |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InStreamFromIterativeWriter(int bufSize,
int incSize,
int minWriteSize,
int writeCushion)
bufSize - Buffer SizeincSize - Bytes by which to increment Buffer Size. Expanding the
buffer will be required when the IterativeWriter's nextWrite method
writes too many bytes beyond the requested size.minWriteSize - Minimum Write request size for the IterativeWrite's
nextWrite() callwriteCushion - Bytes by which the actual bytes written may exceed
the requested number of bytes for the ItertativeWriter's nextWrite()
call. If the nextWrite() call overshoots this limit also then a buffer
expansion may be required which affects performance.public InStreamFromIterativeWriter(int bufSize)
bufSize - Buffer Sizepublic InStreamFromIterativeWriter()
| Method Detail |
|---|
public OutputStream getWriterOutputStream()
ByteCounter and can be cast to a ByteCounter for
the IterativeWriter to keep track of the number of bytes written.setIterativeWriter(IterativeWriter)public void setIterativeWriter(IterativeWriter iterativeWriter)
iterativeWriter - IterativeWriter to call to write data. The
iterativeWriter must write to the OutputStream got by the
getWriterOutputStream() call.getWriterOutputStream()
public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOException - If the nextWrite() call of the iterativeWriter
throws an IOExceptionIterativeWriter.nextWrite(int)
public int read()
throws IOException
read in class InputStreamIOException - If the nextWrite() call of the iterativeWriter
throws an IOExceptionIterativeWriter.nextWrite(int)
public long skip(long n)
throws IOException
skip in class InputStreamIOException - If the nextWrite() call of the iterativeWriter
throws an IOExceptionIterativeWriter.nextWrite(int)
public int available()
throws IOException
available in class InputStreamIOExceptionpublic int getMaxBufSize()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||