## org.apache.poi.util
Class BlockingInputStream

    java.lang.Object
      java.io.InputStream
          org.apache.poi.util.BlockingInputStream

public class BlockingInputStream
extends java.io.InputStream

Implementation of a BlockingInputStream to provide data to RawDataBlock that expects data in 512 byte chunks. Useful to read data from slow (ie, non FileInputStream) sources, for example when reading an OLE2 Document over a network. Possible extentions: add a timeout. Curently a call to read(byte[]) on this class is blocking, so use at your own peril if your underlying stream blocks.

Author:
  Jens Gerhard, aviks - documentation cleanups.

Field Summary
`protected java.io.InputStream` `is`

Constructor Summary
`BlockingInputStream(java.io.InputStream is)`

Method Summary
`int` `available()`
`void` `close()`
`void` `mark(int readLimit)`
`boolean` `markSupported()`
`int` `read()`
`int` `read(byte[] bf)` We had to revert to byte per byte reading to keep with slow network connections on one hand, without missing the end-of-file.
`int` `read(byte[] bf, int s, int l)`
`void` `reset()`
`long` `skip(long n)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### is

    protected java.io.InputStream is

Constructor Detail

### BlockingInputStream

    public BlockingInputStream(java.io.InputStream is)

Method Detail

### available

    public int available()
                  throws java.io.IOException

  Throws:
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### mark

    public void mark(int readLimit)

### markSupported

    public boolean markSupported()

### read

    public int read()
             throws java.io.IOException

  Throws:
    `java.io.IOException`

### read

    public int read(byte[] bf)
             throws java.io.IOException

  We had to revert to byte per byte reading to keep with slow network connections on one hand, without missing the end-of-file. This is the only method that does its own thing in this class everything else is delegated to aggregated stream. THIS IS A BLOCKING BLOCK READ!!!

  Throws:
    `java.io.IOException`

### read

    public int read(byte[] bf,
                    int s,
                    int l)
             throws java.io.IOException

  Throws:
    `java.io.IOException`

### reset

    public void reset()
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### skip

    public long skip(long n)
              throws java.io.IOException

  Throws:
    `java.io.IOException`

Copyright © 2003 Apache Software Foundation.