Notice: register_sidebar was called incorrectly. No id was set in the arguments array for the "Sidebar 1" sidebar. Defaulting to "sidebar-1". Manually set the id to "sidebar-1" to silence this notice and keep existing sidebar content. Please see Debugging in WordPress for more information. (This message was added in version 4.2.0.) in /usr/share/wordpress/wp-includes/functions.php on line 4139 Tech Notes » Blog Archive » Java getOutputStream() surprises

Java getOutputStream() surprises

Uncategorized Add comments

As a not to my future self, apparently you need to open the connection before setting doOutput:

URLConnection connection = url.openConnection();
connection.setDoOutput(true);

return connection.getOutputStream();

It’s a good thing that’s poorly documented and non-obvious, and that it fails in misleading ways.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in