0

I have a source like this:

public class Main {

    public static void main(String[] args) {
        byte[] b = { 100, 101, 99, 120, 98 ... };
         ...
}

}

How can I get around the code too large error, if I exclude the possibility of downloading a file from disk or from the Internet?

  • Reading the values from a file would still be the sane option. If that's not possible, try splitting up the values across different methods. Just know that you cannot get this exception when you write good code. Also, not sure who tells you that you cannot read it from a file, but I think you have sufficient arguments to start doing it now. – Nico Van Belle May 24 '22 at 10:23
  • You can create a resource file by parsing the (further unneeded) java source and storing `(byte) Integer.parseInt("100")`. Possibly gzipped. `Files.copy` for copying the resource. – Joop Eggen May 24 '22 at 10:23
  • @user207421 I did not say same but sane – Nico Van Belle May 24 '22 at 11:00
  • @NicoVanBelle Thank you, my mistake. Still a compilation error, not an exception, though. – user207421 May 25 '22 at 00:44

0 Answers0