Stop using Arrays.checkOffsetAndCount.
Start using ArrayUtils.throwsIfOutOfBounds instead. The Arrays method is going to be removed. Bug: 78447530 Test: cts-tradefed run cts-dev -m CtsOsTestCases (shows only unrelated failures: two user/userdebug mismatches and one from b/79471510) Test: cts-tradefed run cts-dev -m CtsDrmTestCases Test: adb shell am instrument -w -e class android.content.pm.LimitedLengthInputStreamTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner Test: adb shell am instrument -w -e class android.os.FileBridgeTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner Change-Id: Ib3cd4f4ead61dbec1ccdc94b2ad4ad9c28574582
This commit is contained in:
@@ -27,13 +27,13 @@ import android.util.Log;
|
||||
|
||||
import libcore.io.IoBridge;
|
||||
import libcore.io.Streams;
|
||||
import libcore.util.ArrayUtils;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.FilterOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.UnknownServiceException;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Stream that applies a {@link DrmManagerClient} transformation to data before
|
||||
@@ -91,7 +91,7 @@ public class DrmOutputStream extends OutputStream {
|
||||
|
||||
@Override
|
||||
public void write(byte[] buffer, int offset, int count) throws IOException {
|
||||
Arrays.checkOffsetAndCount(buffer.length, offset, count);
|
||||
ArrayUtils.throwsIfOutOfBounds(buffer.length, offset, count);
|
||||
|
||||
final byte[] exactBuffer;
|
||||
if (count == buffer.length) {
|
||||
|
||||
Reference in New Issue
Block a user