Is there any character limit for the output of Java\'s System.out.println(String x)
statement?
When I try to print some XML from a web service call usin
I know that printing very long strings into the Eclipse console results in part or all of the string becoming invisible. You may want to break your xml into chunks. If you are only seeing the tail part of the xml then I'd guess its your console buffer trimming off part of it. @Quaylar posted a link about this.
There isn't really an explicit maximum, but the offset in the string is determined by int, so Integer.MaxValue would be one limitation IMO. It also would depend on your available memory.
Your best bet would be to stream the output and write portions at a time to ensure you get it all.
My guess is that you only see the last part of the String because the console has a limited number of lines it can display.
Consider logging to a file from Java, or redirecting the standard output from the program to a file:
java com.foo.bar.Main > output.log
Are you experiencing this within Eclipse? If yes:
EDIT:
Source
If you are using Eclipse, it is because there is a limit on the capacity of the Eclipse output console. See this SO question: How do I increase the capacity of the Eclipse output console?
You're limited by the maximum size of a Java String. That's all. This should be the equivalent of length Integer.MAX_VALUE (2147483647), which is the max size of an array, since a String is a char array.
Otherwise, it's the Eclipse console capacity limit, as others have said.