Sorry, I misread what happened. Got it now.

What if calling connect() before BufferedOutputStream#write like the following? I feel it's easier to understand and read the code. 

```
            connect();
            if (properties != null && properties.size() > 0) {
                StringBuffer buf = new StringBuffer();
                for(Entry<String, String> property : properties.entrySet()) {
                   :
                }
                OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
                writer.write(buf.toString());
                writer.flush();
            }

            Log.d(TAG, "post: url=" + url + ", conn=" + conn.hashCode());
              :
```