Today I learned: to save gzipped contents into a source file (for instance for unit testing), copy-paste doesn't work, as the java won't accept the raw characters in a java source file. Instead, first - the contents, and paste that into the source file. Base64 converts anything to [a-z0-9]/i, which is accepted by javac.

This in response to the earlier revelation that a method can't have more than an integer count of arguments, so we can't pass in more than 65,535 lines of a file (because the 65,536th argument is for the implied "this" argument). And my file happens to be slightly larger than that. By about 130,000 lines. Gzipping and Base64 encoding reduced that to a single line of roughly 10,000 characters, which is accepted by the .

Note that will fail to compile test source code files if that many lines are passed into a method during static initialization, or if the equivalent amount of data (155KB) is assigned to a String constant.

@aeveltstra can you post the signature of this method. I am not sure how one would write a method with so many arguments?

@aeveltstra okay found your other post with the varargs. Interesting, I always thought it is syntactic sugar for an array.

Sign in to participate in the conversation

Invite-only Mastodon server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!