Documentation of 'org.apache.poi.util.BlockingInputStream' Java class
BlockingInputStream
org.apache.poi.util

Class BlockingInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable


    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.
    • Constructor Summary

      Constructors 
      Constructor and Description
      BlockingInputStream(java.io.InputStream is) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      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

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlockingInputStream

        public BlockingInputStream(java.io.InputStream is)
    • Method Detail

      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.InputStream
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class java.io.InputStream
        Throws:
        java.io.IOException
      • mark

        public void mark(int readLimit)
        Overrides:
        mark in class java.io.InputStream
      • markSupported

        public boolean markSupported()
        Overrides:
        markSupported in class java.io.InputStream
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        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!!!
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read(byte[] bf,
                        int s,
                        int l)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class java.io.InputStream
        Throws:
        java.io.IOException
      • skip

        public long skip(long n)
                  throws java.io.IOException
        Overrides:
        skip in class java.io.InputStream
        Throws:
        java.io.IOException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.