mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
parent
51f27631ef
commit
fad697ba2a
@ -19,6 +19,7 @@ package org.thoughtcrime.securesms.crypto;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.util.LimitedInputStream;
|
import org.thoughtcrime.securesms.util.LimitedInputStream;
|
||||||
|
import org.thoughtcrime.securesms.util.Util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
@ -139,5 +140,30 @@ public class DecryptingPartInputStream {
|
|||||||
Log.w(TAG, t);
|
Log.w(TAG, t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long skip(long skipAmount)
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
long remaining = skipAmount;
|
||||||
|
|
||||||
|
if (skipAmount <= 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
byte[] skipBuffer = new byte[4092];
|
||||||
|
|
||||||
|
while (remaining > 0) {
|
||||||
|
int read = super.read(skipBuffer, 0, Util.toIntExact(Math.min(skipBuffer.length, remaining)));
|
||||||
|
|
||||||
|
if (read < 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
remaining -= read;
|
||||||
|
}
|
||||||
|
|
||||||
|
return skipAmount - remaining;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user