Unmodifiable collections can STILL throw ConcurrentModificationExceptions
Please remember this and use CopyOnWriteArrayList instead.
Showing posts with label exception. Show all posts
Showing posts with label exception. Show all posts
Friday, 26 November 2010
Friday, 24 July 2009
Exception StackTrace to String
How many times have I forgotten this:
While we are at it: InputStream to String:
http://stackoverflow.com/questions/309424/in-java-how-do-a-read-an-input-stream-in-to-a-string
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
String result = sw.toString();
While we are at it: InputStream to String:
final StringWriter writer = new StringWriter();
IOUtils.copy(urlConnection.getInputStream(), writer);
result = writer.toString();
http://stackoverflow.com/questions/309424/in-java-how-do-a-read-an-input-stream-in-to-a-string
Subscribe to:
Posts (Atom)