1010import com .bumptech .glide .load .engine .bitmap_recycle .ArrayPool ;
1111import com .bumptech .glide .load .engine .bitmap_recycle .LruArrayPool ;
1212import com .bumptech .glide .testutil .TestResourceUtil ;
13+ import com .google .common .io .ByteStreams ;
1314import java .io .ByteArrayInputStream ;
1415import java .io .FilterInputStream ;
1516import java .io .IOException ;
1920import org .junit .Test ;
2021import org .junit .runner .RunWith ;
2122import org .robolectric .RobolectricTestRunner ;
22- import org .robolectric .util .Util ;
2323
2424@ RunWith (RobolectricTestRunner .class )
2525public class DefaultImageHeaderParserTest {
@@ -505,7 +505,8 @@ public void run(
505505
506506 @ Test
507507 public void testCanParseRealAnimatedWebpFile () throws IOException {
508- byte [] data = Util .readBytes (TestResourceUtil .openResource (getClass (), "animated_webp.webp" ));
508+ byte [] data =
509+ ByteStreams .toByteArray (TestResourceUtil .openResource (getClass (), "animated_webp.webp" ));
509510 runTest (
510511 data ,
511512 new ParserTestCase () {
@@ -822,7 +823,8 @@ public void run(
822823
823824 @ Test
824825 public void testCanParseRealAnimatedAvifFile () throws IOException {
825- byte [] data = Util .readBytes (TestResourceUtil .openResource (getClass (), "animated_avif.avif" ));
826+ byte [] data =
827+ ByteStreams .toByteArray (TestResourceUtil .openResource (getClass (), "animated_avif.avif" ));
826828 runTest (
827829 data ,
828830 new ParserTestCase () {
@@ -866,7 +868,7 @@ public void run(
866868 @ Test
867869 public void testHandlesParsingOrientationWithMinimalExifSegment () throws IOException {
868870 byte [] data =
869- Util . readBytes (TestResourceUtil .openResource (getClass (), "short_exif_sample.jpg" ));
871+ ByteStreams . toByteArray (TestResourceUtil .openResource (getClass (), "short_exif_sample.jpg" ));
870872 runTest (
871873 data ,
872874 new ParserTestCase () {
@@ -1016,7 +1018,8 @@ public void getOrientation_withExifSegmentAndPreambleBetweenLengthAndExpected_re
10161018 @ Test
10171019 public void hasJpegMpf_withGainmapFile_returnsTrue () throws IOException {
10181020 byte [] data =
1019- Util .readBytes (TestResourceUtil .openResource (getClass (), "small_gainmap_image.jpg" ));
1021+ ByteStreams .toByteArray (
1022+ TestResourceUtil .openResource (getClass (), "small_gainmap_image.jpg" ));
10201023 runTest (
10211024 data ,
10221025 new ParserTestCase () {
@@ -1038,7 +1041,7 @@ public void run(
10381041 @ Test
10391042 public void hasJpegMpf_withNonGainmapFile_returnsFalse () throws IOException {
10401043 byte [] data =
1041- Util . readBytes (TestResourceUtil .openResource (getClass (), "short_exif_sample.jpg" ));
1044+ ByteStreams . toByteArray (TestResourceUtil .openResource (getClass (), "short_exif_sample.jpg" ));
10421045 runTest (
10431046 data ,
10441047 new ParserTestCase () {
0 commit comments