title: Stream closed error when getting charset
body: <p>I'm having issues with the following code:</p>
  
  <pre><code>try (
        InputStream is = new FileInputStream(file);
        BufferedReader br = new BufferedReader(
                     new InputStreamReader(is,
                       Charset.forName(SidFileUtils.charsetDetection(is))
                     )
                   );
      ) {
  
          br.readLine();
          br.readLine();
  
          for (String line = br.readLine() ; line != null ; line = br.readLine()) {
              lines.add(line);
          }
      } catch (ExceptionTechnique | IOException e) {
          LOG.error("Erreur lors de la lecture du fichier " + file.getName(), e);
      }
  </code></pre>
  
  <p>This part of the code: <code>Chasrset.forName(...)</code> is giving me a <code>Stream Closed error</code>. I think it's because I'm using the <code>InputStream</code> item twice and it has already been consumed but I'm not sure.</p>
  
  <p>Can you help me understand what is wrong with this code please ?</p>
  
  <p>Thanks a lot in advance !</p>