Simplify HttpURLConnectionTest.readAscii().

HttpURLConnectionTest had a helper method readAscii(InputStream, int)
that read up to the given number of bytes. Most callers were passing
Integer.MAX_VALUE to read the entire InputStream.

This CL adds a helper method to simplify this common use case, and
makes the helper methods static.

A bunch of these calls could be simplified further by making use
of the helper method assertContent(String, URLConnection), but
this simplification is left to a potential future CL.

Test: atest CtsLibcoreTestCases:libcore.java.net.URLConnectionTest

Change-Id: Ib693cfd95c11b674a683f1102d26682e4cfb458d
1 file changed