mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 16:19:33 +01:00
Skip attachments with unrecoverable errors during sms export.
This commit is contained in:
committed by
Greyson Parrelli
parent
57e8684bb3
commit
10e8c6d795
@@ -22,6 +22,8 @@ import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
public class ModernDecryptingPartInputStream {
|
||||
|
||||
public static final String PREMATURE_END_ERROR_MESSAGE = "Prematurely reached end of stream!";
|
||||
|
||||
public static InputStream createFor(@NonNull AttachmentSecret attachmentSecret, @NonNull byte[] random, @NonNull File file, long offset)
|
||||
throws IOException
|
||||
{
|
||||
@@ -75,7 +77,7 @@ public class ModernDecryptingPartInputStream {
|
||||
for (;;) {
|
||||
int read = in.read(buffer, offset, buffer.length-offset);
|
||||
|
||||
if (read == -1) throw new IOException("Prematurely reached end of stream!");
|
||||
if (read == -1) throw new IOException(PREMATURE_END_ERROR_MESSAGE);
|
||||
else if (read + offset < buffer.length) offset += read;
|
||||
else return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user