com.kuka.common
Class InbandBlobInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by com.kuka.common.InbandBlobInputStream
All Implemented Interfaces:
Closeable

public class InbandBlobInputStream
extends FilterInputStream

Input stream that decodes data sent over a stream by InbandBlobOutputStream. The underlying stream will not be closed unless an error occurred while transmitting. The reason is that in this case we cannot be sure what part of the encoded data has been successfully transmitted.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
InbandBlobInputStream(InputStream in)
          Creates a new instance of the stream filter.
 
Method Summary
 int available()
           
 void close()
          Reads the rest of the BLOB data and discards it.
 void mark(int readlimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 
Methods inherited from class java.io.FilterInputStream
read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InbandBlobInputStream

public InbandBlobInputStream(InputStream in)
Creates a new instance of the stream filter.

Parameters:
in - the underlying stream
Method Detail

available

public int available()
              throws IOException
Overrides:
available in class FilterInputStream
Throws:
IOException

read

public int read()
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class FilterInputStream

mark

public void mark(int readlimit)
Overrides:
mark in class FilterInputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class FilterInputStream
Throws:
IOException

close

public void close()
           throws IOException
Reads the rest of the BLOB data and discards it. Does NOT close the underlying stream that got passed in to the constructor, unless an IOException occurs.

Specified by:
close in interface Closeable
Overrides:
close in class FilterInputStream
Throws:
IOException - if an I/O error occurred


Copyright © 2019. All rights reserved.