title: problem using base64 encoder and InputStreamReader
body: <p>I have some CLOB columns in a database that I need to put Base64 encoded binary files in.
  These files can be large, so I need to stream them, I can't read the whole thing in at once.</p>
  
  <p>I'm using <code>org.apache.commons.codec.binary.Base64InputStream</code> to do the encoding, and I'm running into a problem.  My code is essentially this</p>
  
  <pre><code>FileInputStream fis = new FileInputStream(file);
  Base64InputStream b64is = new Base64InputStream(fis, true, -1, null);
  BufferedReader reader = new BufferedReader(new InputStreamReader(b64is));
  
  preparedStatement.setCharacterStream(1, reader);
  </code></pre>
  
  <p>When I run the above code, I get one of these during the execution of the update
  <code>java.io.IOException: Underlying input stream returned zero bytes</code>, it is thrown deep in the InputStreamReader code.</p>
  
  <p>Why would this not work?  It seems to me like the <code>reader</code> would attempt to read from the base 64 stream, which would read from the file stream, and everything should be happy.</p>