Loading core/java/android/content/pm/LimitedLengthInputStream.java +3 −2 Original line number Diff line number Diff line package android.content.pm; import libcore.util.ArrayUtils; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; /** * A class that limits the amount of data that is read from an InputStream. When Loading Loading @@ -71,7 +72,7 @@ public class LimitedLengthInputStream extends FilterInputStream { } final int arrayLength = buffer.length; Arrays.checkOffsetAndCount(arrayLength, offset, byteCount); ArrayUtils.throwsIfOutOfBounds(arrayLength, offset, byteCount); if (mOffset > Long.MAX_VALUE - byteCount) { throw new IOException("offset out of bounds: " + mOffset + " + " + byteCount); Loading core/java/android/os/FileBridge.java +2 −2 Original line number Diff line number Diff line Loading @@ -27,12 +27,12 @@ import libcore.io.IoBridge; import libcore.io.IoUtils; import libcore.io.Memory; import libcore.io.Streams; import libcore.util.ArrayUtils; import java.io.FileDescriptor; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteOrder; import java.util.Arrays; /** * Simple bridge that allows file access across process boundaries without Loading Loading @@ -178,7 +178,7 @@ public class FileBridge extends Thread { @Override public void write(byte[] buffer, int byteOffset, int byteCount) throws IOException { Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount); ArrayUtils.throwsIfOutOfBounds(buffer.length, byteOffset, byteCount); Memory.pokeInt(mTemp, 0, CMD_WRITE, ByteOrder.BIG_ENDIAN); Memory.pokeInt(mTemp, 4, byteCount, ByteOrder.BIG_ENDIAN); IoBridge.write(mClient, mTemp, 0, MSG_LENGTH); Loading core/java/android/os/Parcel.java +3 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import dalvik.annotation.optimization.CriticalNative; import dalvik.annotation.optimization.FastNative; import dalvik.system.VMRuntime; import libcore.util.ArrayUtils; import libcore.util.SneakyThrow; import java.io.ByteArrayInputStream; Loading @@ -47,7 +48,6 @@ import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; Loading Loading @@ -631,7 +631,7 @@ public final class Parcel { writeInt(-1); return; } Arrays.checkOffsetAndCount(b.length, offset, len); ArrayUtils.throwsIfOutOfBounds(b.length, offset, len); nativeWriteByteArray(mNativePtr, b, offset, len); } Loading Loading @@ -660,7 +660,7 @@ public final class Parcel { writeInt(-1); return; } Arrays.checkOffsetAndCount(b.length, offset, len); ArrayUtils.throwsIfOutOfBounds(b.length, offset, len); nativeWriteBlob(mNativePtr, b, offset, len); } Loading drm/java/android/drm/DrmOutputStream.java +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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) { Loading Loading
core/java/android/content/pm/LimitedLengthInputStream.java +3 −2 Original line number Diff line number Diff line package android.content.pm; import libcore.util.ArrayUtils; import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Arrays; /** * A class that limits the amount of data that is read from an InputStream. When Loading Loading @@ -71,7 +72,7 @@ public class LimitedLengthInputStream extends FilterInputStream { } final int arrayLength = buffer.length; Arrays.checkOffsetAndCount(arrayLength, offset, byteCount); ArrayUtils.throwsIfOutOfBounds(arrayLength, offset, byteCount); if (mOffset > Long.MAX_VALUE - byteCount) { throw new IOException("offset out of bounds: " + mOffset + " + " + byteCount); Loading
core/java/android/os/FileBridge.java +2 −2 Original line number Diff line number Diff line Loading @@ -27,12 +27,12 @@ import libcore.io.IoBridge; import libcore.io.IoUtils; import libcore.io.Memory; import libcore.io.Streams; import libcore.util.ArrayUtils; import java.io.FileDescriptor; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteOrder; import java.util.Arrays; /** * Simple bridge that allows file access across process boundaries without Loading Loading @@ -178,7 +178,7 @@ public class FileBridge extends Thread { @Override public void write(byte[] buffer, int byteOffset, int byteCount) throws IOException { Arrays.checkOffsetAndCount(buffer.length, byteOffset, byteCount); ArrayUtils.throwsIfOutOfBounds(buffer.length, byteOffset, byteCount); Memory.pokeInt(mTemp, 0, CMD_WRITE, ByteOrder.BIG_ENDIAN); Memory.pokeInt(mTemp, 4, byteCount, ByteOrder.BIG_ENDIAN); IoBridge.write(mClient, mTemp, 0, MSG_LENGTH); Loading
core/java/android/os/Parcel.java +3 −3 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import dalvik.annotation.optimization.CriticalNative; import dalvik.annotation.optimization.FastNative; import dalvik.system.VMRuntime; import libcore.util.ArrayUtils; import libcore.util.SneakyThrow; import java.io.ByteArrayInputStream; Loading @@ -47,7 +48,6 @@ import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; Loading Loading @@ -631,7 +631,7 @@ public final class Parcel { writeInt(-1); return; } Arrays.checkOffsetAndCount(b.length, offset, len); ArrayUtils.throwsIfOutOfBounds(b.length, offset, len); nativeWriteByteArray(mNativePtr, b, offset, len); } Loading Loading @@ -660,7 +660,7 @@ public final class Parcel { writeInt(-1); return; } Arrays.checkOffsetAndCount(b.length, offset, len); ArrayUtils.throwsIfOutOfBounds(b.length, offset, len); nativeWriteBlob(mNativePtr, b, offset, len); } Loading
drm/java/android/drm/DrmOutputStream.java +2 −2 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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) { Loading