mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
We don't support unknown content lengths yet.
This commit is contained in:
@@ -157,6 +157,9 @@ public class MmsCommunication {
|
|||||||
if (entity == null || entity.getContentLength() == 0)
|
if (entity == null || entity.getContentLength() == 0)
|
||||||
throw new IOException("Null response");
|
throw new IOException("Null response");
|
||||||
|
|
||||||
|
if (entity.getContentLength() < 0)
|
||||||
|
throw new IOException("Unknown content length!");
|
||||||
|
|
||||||
byte[] responseBytes = new byte[(int)entity.getContentLength()];
|
byte[] responseBytes = new byte[(int)entity.getContentLength()];
|
||||||
DataInputStream dataInputStream = new DataInputStream(entity.getContent());
|
DataInputStream dataInputStream = new DataInputStream(entity.getContent());
|
||||||
dataInputStream.readFully(responseBytes);
|
dataInputStream.readFully(responseBytes);
|
||||||
|
|||||||
Reference in New Issue
Block a user