Buggy code:
public static final int ASYNC_METHOD_POST = 1 << 1 ; public static final int ASYNC_METHOD_POSTBYTES = 1 << 2 ; public static final String ASYNC_RESULT_BUNDLE_KEY_HTTP_STATUS = "status" ; public static final String ASYNC_RESULT_BUNDLE_KEY_HTTP_CONTENTTYPE = "type" ; public static final String ASYNC_RESULT_BUNDLE_KEY_HTTP_BODY = "body" ; public static final String BASE_URL = "http:////cyphone.nate.com//" ; private HashMap < HttpRequest , HttpURLConnection > connectionPool ; public static int convertFoundToOk ( int http_status ) { } private HttpUtility ( ) { } public static HttpUtility getInstance ( ) { } public synchronized void setProgressListener ( int progressTag , ProgressListener listener ) { } public static final void setConnectionTimeout ( int newConnectionTimeoutMillis ) { } public static final int getConnectionTimeout ( ) { } public static final void setReadTimeout ( int newReadTimeoutMillis ) { } public static final int getReadTimeout ( ) { } public static final void setUseCaches ( boolean useCashesOrNot ) { } public static final boolean getUseCaches ( ) { } public static String getUrlStringWithQuery ( String url , Map < String , String > parameters ) { } public void disconnectConnection ( HttpRequest request ) { } public HttpUtility . SimpleHttpResponse get ( String url , Map < String , String > headerValues , Map < String , String > getParameters , HttpRequest request ) { } public HttpUtility . SimpleHttpResponse post ( String url , Map < String , String > headerValues , Map < String , Object > postParameters , HttpRequest request ) { HttpURLConnection connection = null ; connectionPool . put ( request , connection ) ; try { URL u = new URL ( url ) ; if ( u . getProtocol ( ) . toLowerCase ( ) . equals ( "https" ) ) { HttpUtility . trustAllHosts ( ) ; HttpsURLConnection https = ( ( HttpsURLConnection ) ( u . openConnection ( ) ) ) ; https . setHostnameVerifier ( HttpUtility . DO_NOT_VERIFY ) ; connection = https ; } else { connection = ( ( HttpURLConnection ) ( u . openConnection ( ) ) ) ; } connection . setRequestMethod ( "POST" ) ; connection . setDoOutput ( true ) ; connection . setDoInput ( true ) ; connection . setUseCaches ( HttpUtility . getUseCaches ( ) ) ; connection . setConnectTimeout ( HttpUtility . getConnectionTimeout ( ) ) ; connection . setReadTimeout ( HttpUtility . getReadTimeout ( ) ) ; connectionPool . put ( request , connection ) ; } catch ( Exception e ) { Log . e ( "HttpUtility.post" , e . toString ( ) ) ; if ( connection != null ) disconnectConnection ( request ) ; return null ; } if ( headerValues != null ) for ( String key : headerValues . keySet ( ) ) connection . setRequestProperty ( key , headerValues . get ( key ) ) ; if ( postParameters != null ) { boolean fileExists = false ; for ( String key : postParameters . keySet ( ) ) { if ( ( postParameters . get ( key ) . getClass ( ) ) == ( ( Object ) ( File . class ) ) ) { fileExists = true ; break ; } } try { DataOutputStream dos = null ; if ( fileExists ) { String boundary = "01asfasf290481209" ; String startBoundary = ( "--" + boundary ) + "\r\n" ; String endBoundary = "\r\n" ; String finalEndBoundary = ( "\r\n--" + boundary ) + "--\r\n" ; connection . setRequestProperty ( "Content-Type" , ( "multipart//form-data;boundary=" + boundary ) ) ; dos = new DataOutputStream ( connection . getOutputStream ( ) ) ; for ( String key : postParameters . keySet ( ) ) { dos . writeBytes ( startBoundary ) ; Object value = postParameters . get ( key ) ; if ( ( value . getClass ( ) ) == ( File . class ) ) { File file = ( ( File ) ( value ) ) ; <START_BUG> File compressedFile = ImageUtil . decodeFileToFile ( file , 80 , false ) ; <END_BUG> if ( compressedFile != null ) { file = compressedFile ; } dos . writeBytes ( ( ( ( ( "Content-Disposition:<seq2seq4repair_space>form-data;<seq2seq4repair_space>name=\"" + key ) + "\";<seq2seq4repair_space>filename=\"" ) + ( file . getName ( ) ) ) + "\"\r\n" ) ) ; dos . writeBytes ( ( ( "Content-Type:<seq2seq4repair_space>" + ( HttpUtility . getMimeType ( ( ( File ) ( value ) ) ) ) ) + "\r\n" ) ) ; dos . writeBytes ( "Content-Transfer-Encoding:<seq2seq4repair_space>binary\r\n\r\n" ) ; FileInputStream fis = new FileInputStream ( file ) ; int totalSize = fis . available ( ) ; byte [ ] buffer = new byte [ HttpUtility . FILE_BUFFER_SIZE ] ; int bytesRead = 0 ; while ( ( bytesRead = fis . read ( buffer , 0 , HttpUtility . FILE_BUFFER_SIZE ) ) > 0 ) { dos . write ( buffer , 0 , bytesRead ) ; if ( ( progressListener ) != null ) { progressListener . onWritten ( progressTag , totalSize , bytesRead ) ; } } fis . close ( ) ; } else { dos . writeBytes ( ( ( "Content-Disposition:<seq2seq4repair_space>form-data;<seq2seq4repair_space>name=\"" + key ) + "\"\r\n\r\n" ) ) ; dos . writeBytes ( value . toString ( ) ) ; } dos . writeBytes ( endBoundary ) ; } dos . writeBytes ( finalEndBoundary ) ; } else { connection . setRequestProperty ( "Content-Type" , "application//x-www-form-urlencoded" ) ; dos = new DataOutputStream ( connection . getOutputStream ( ) ) ; StringBuffer buffer = new StringBuffer ( ) ; for ( String key : postParameters . keySet ( ) ) { if ( ( buffer . length ( ) ) > 0 ) buffer . append ( "&" ) ; buffer . append ( HttpUtility . urlencode ( key ) ) ; buffer . append ( "=" ) ; buffer . append ( HttpUtility . urlencode ( postParameters . get ( key ) . toString ( ) ) ) ;

Fix:
File compressedFile = ImageUtil . compressFile ( file , 80 ) ;