title: Java: FilterInputStream what are the advantages and use compared to other streams
body: <p>I’ve been reading on <em>InputStream</em>, <em>FileInputStream</em>, <em>ByteArrayInputStream</em> and how their use seems quite clear (output streams too).</p>
  
  <p>What I’m struggling is to understand the use of <strong>FilterInputStream &amp; FilterOutputStream</strong>:</p>
  
  <ul>
  <li>What is the advantage of using it compared to the other stream classes?</li>
  <li>When should I use it?</li>
  <li>Please provide a theoretical explanation and a basic example.</li>
  </ul>