ByteArrayOutputStream i4 = new ByteArrayOutputStream(); i4.write(("--" + i3 + System.lineSeparator() + "Content-Disposition: form-data; name=\"" + I1.this.i2 + "\"; filename=\"" + I1.this.i2 + ".jpg\"" + System.lineSeparator() + "Content-Type: " + HttpURLConnection.guessContentTypeFromName(I1.this.i2 + ".jpg") + System.lineSeparator() + "Content-Transfer-Encoding: binary" + System.lineSeparator() + System.lineSeparator()).getBytes()); i4.flush(); i4.write(i2.this.i1); i4.flush(); i4.write((System.lineSeparator() + "--" + i3 + "--" + System.lineSeparator()).getBytes()); i4.flush(); i4.close(); HttpURLConnection i5 = (HttpURLConnection) new URL("***").openConnection(); i5.setRequestMethod("POST"); i5.setRequestProperty("User-Agent", "Mozilla/5.0"); i5.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + i3); OutputStream i6 = i5.getOutputStream(); i6.write(i4.toByteArray()); i6.flush(); i6.close(); i5.getResponseCode(); // ЗДЕСЬ ВЫЛЕТАЕТ ИСКЛЮЧЕНИЕ i5.disconnect(); What's wrong with my code? Why does java.io.EOFException ? On Android 4.2, everything worked perfectly, but as soon as I installed the same application with this code on a new Android phone version 4.4.2, this problem suddenly happens.
This, this , and this , unfortunately, does not solve the problem.