title: base64 encoding of png binary doesn't work JDK 11.0.3+7 Eclipse 4.11.0
body: <p>The following code</p>
  
  <pre><code>import java.util.Base64;
  
  try (final InputStream fis = new FileInputStream(new File("foobar.png"))) {
      final String str = Base64.getEncoder().encodeToString(fis.readAllBytes());
  
      System.out.println("+++" + str + "+++"); // prints nothing!
  
      System.out.println("+++" + str.length() + "+++"); // +++34500+++
      System.out.println("+++" + str.isBlank() + "+++"); // +++false+++
  
      try (final OutputStream os = new FileOutputStream(new File("foobar.txt"))) {
          os.write(str.getBytes()); // empty file!
      }
  
      final String str2 = "foobar";
      try (final OutputStream os2 = new FileOutputStream(new File("foobar2.txt"))) {
          os2.write(Base64.getEncoder().encodeToString(str2.getBytes()); // This works!
      }
  }
  </code></pre>
  
  <p>doesn't print anything it the first call of <code>System.out.println</code>. What's wrong? Moreover when I write a file with the base64 encoded string the file is empty.</p>
  
  <p>When I write all the read bytes back to file system without base64 encoding than the two files are equal. So, that's okay. But what's wrong with the encoding?</p>
  
  <p><code>foobar.png</code> has 26 KiB on file system.</p>
  
  <p>Adopt JDK 11.0.3+7</p>
  
  <p>Eclipse: 2019-03 (4.11.0)</p>
  
  <h2>Solution</h2>
  
  <p>Thanks to Robert. This is obviously only a <strong>display problem in my Eclipse</strong> version.</p>