Index: trunk/src/org/openstreetmap/josm/tools/Base64.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Base64.java	(revision 7059)
+++ trunk/src/org/openstreetmap/josm/tools/Base64.java	(revision 7060)
@@ -4,5 +4,13 @@
 import java.nio.ByteBuffer;
 
+/**
+ * This class implements an encoder for encoding byte and character data using the
+ * <a href="https://en.wikipedia.org/wiki/Base64">Base64</a> encoding scheme as specified in
+ * <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a> ("base64", default) and
+ * <a href="http://tools.ietf.org/html/rfc4648#section-4">RFC 4648</a> ("base64url").
+ * @since 195
+ */
 public final class Base64 {
+    // TODO: Remove this class when switching to Java 8 (finally integrated in Java SE as java.util.Base64.Encoder)
 
     private Base64() {
@@ -10,11 +18,25 @@
     }
     
+    /** "base64": RFC 2045 default encoding */
     private static String encDefault = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    /** "base64url": RFC 4648 url-safe encoding */
     private static String encUrlSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
 
+    /**
+     * Encodes all characters from the specified string into a new String using the Base64 default encoding scheme.
+     * @param s the string to encode
+     * @return A new string containing the resulting encoded characters.
+     */
     public static String encode(String s) {
         return encode(s, false);
     }
 
+    /**
+     * Encodes all characters from the specified string into a new String using a supported Base64 encoding scheme.
+     * @param s the string to encode
+     * @param urlsafe if {@code true}, uses "base64url" encoding, otherwise use the "base64" default encoding
+     * @return A new string containing the resulting encoded characters.
+     * @since 3840
+     */
     public static String encode(String s, boolean urlsafe) {
         StringBuilder out = new StringBuilder();
@@ -35,8 +57,22 @@
     }
 
+    /**
+     * Encodes all remaining bytes from the specified byte buffer into a new string using the Base64 default encoding scheme.
+     * Upon return, the source buffer's position will be updated to its limit; its limit will not have been changed.
+     * @param s the source ByteBuffer to encode
+     * @return A new string containing the resulting encoded characters.
+     */
     public static String encode(ByteBuffer s) {
         return encode(s, false);
     }
 
+    /**
+     * Encodes all remaining bytes from the specified byte buffer into a new string using a supported Base64 encoding scheme.
+     * Upon return, the source buffer's position will be updated to its limit; its limit will not have been changed.
+     * @param s the source ByteBuffer to encode
+     * @param urlsafe if {@code true}, uses "base64url" encoding, otherwise use the "base64" default encoding
+     * @return A new string containing the resulting encoded characters.
+     * @since 3840
+     */
     public static String encode(ByteBuffer s, boolean urlsafe) {
         StringBuilder out = new StringBuilder();
Index: trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 7059)
+++ trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 7060)
@@ -216,4 +216,5 @@
         ) {
             gzip.write(debugText.getBytes(Utils.UTF_8));
+            gzip.finish();
 
             return new URL(Main.getJOSMWebsite()+"/josmticket?" +
