Class DualInputStreamBuilder


  • public class DualInputStreamBuilder
    extends Object
    The DualInputStreamBuilder class generates two InputStream wrapper objects for one InputStream source.

    Use this class when two independent stream operations are required for one InputStream source. Usually one stream is for temporary use. For example, one stream detects the language and character set for the input stream and another stream is used for the real purpose.

    TIPS: Close either one of the InputStream objects as soon as the operation is completed.

    • Constructor Detail

      • DualInputStreamBuilder

        public DualInputStreamBuilder​(InputStream in,
                                      int size)
        Constructs this object with the source InputStream object.
        Parameters:
        in - InputStream object
        size - the buffer size
      • DualInputStreamBuilder

        public DualInputStreamBuilder​(InputStream in)
        Constructs this object with the source InputStream object.
        Parameters:
        in - InputStream object
    • Method Detail

      • getFirstInputStream

        public InputStream getFirstInputStream()
        Returns the first InputStream object.
        Returns:
        the first InputStream object
      • getSecondInputStream

        public InputStream getSecondInputStream()
        Returns the second InputStream object.
        Returns:
        the second InputStream object