Java: Pass along any http error from server

- add logic to check if response code is 400 or above, getErrorStream, otherwise getInputStream
- check and serve gzip content encoding
- make sure to set error status code in the response