Remove more.

(cherry-pick of f39b5ca3c6378c3c36c63889577004b9693ea9c6.)

Change-Id: Idaf030cd369e728ec37df7107cd30062db899b7c
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/file/FileURLConnectionTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/file/FileURLConnectionTest.java
index 1f4ad1f..d6f2c01 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/file/FileURLConnectionTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/file/FileURLConnectionTest.java
@@ -112,8 +112,6 @@
         assertEquals(conn.getContentType(), conn.getHeaderField("content-type"));
         assertEquals(Integer.toString(conn.getContentLength()),
                 conn.getHeaderField("content-length"));
-        assertEquals(Long.toString(conn.getContentLengthLong()),
-                conn.getHeaderField("content-length"));
         assertEquals(conn.getHeaderField(0), conn.getHeaderField("content-type"));
         assertEquals(conn.getHeaderField(1), conn.getHeaderField("content-length"));
         assertEquals(conn.getHeaderField(2), conn.getHeaderField("last-modified"));
diff --git a/luni/src/main/java/java/net/URLConnection.java b/luni/src/main/java/java/net/URLConnection.java
index cc7de90..2fb3f45 100644
--- a/luni/src/main/java/java/net/URLConnection.java
+++ b/luni/src/main/java/java/net/URLConnection.java
@@ -316,17 +316,6 @@
     }
 
     /**
-     * Returns the content length in bytes specified by the response header field
-     * {@code content-length} or {@code -1} if this field is not set.
-     *
-     * @since 1.7
-     * @hide Until ready for a public API change
-     */
-    public long getContentLengthLong() {
-        return getHeaderFieldLong("Content-Length", -1);
-    }
-
-    /**
      * Returns the MIME-type of the content specified by the response header field
      * {@code content-type} or {@code null} if type is unknown.
      *
@@ -558,27 +547,6 @@
     }
 
     /**
-     * Returns the specified header value as a number. Returns the {@code
-     * defaultValue} if no such header field could be found or the value could
-     * not be parsed as a {@code long}.
-     *
-     * @param field
-     *            the header field name whose value is needed.
-     * @param defaultValue
-     *            the default value if no field has been found.
-     * @return the value of the specified header field as a number.
-     * @since 1.7
-     * @hide Until ready for a public API change
-     */
-    public long getHeaderFieldLong(String field, long defaultValue) {
-        try {
-            return Long.parseLong(getHeaderField(field));
-        } catch (NumberFormatException e) {
-            return defaultValue;
-        }
-    }
-
-    /**
      * Returns the name of the header field at the given position {@code posn} or
      * {@code null} if there are fewer than {@code posn} fields. The base
      * implementation of this method returns always {@code null}.
diff --git a/luni/src/main/java/libcore/net/url/FileURLConnection.java b/luni/src/main/java/libcore/net/url/FileURLConnection.java
index 94fe1d6..43eaa7d 100644
--- a/luni/src/main/java/libcore/net/url/FileURLConnection.java
+++ b/luni/src/main/java/libcore/net/url/FileURLConnection.java
@@ -225,13 +225,8 @@
 
     /**
      * Returns the length of the file in bytes.
-     *
-     * @return the length of the file
-     * @since 1.7
-     * @hide Until ready for a public API change
      */
-    @Override
-    public long getContentLengthLong() {
+    private long getContentLengthLong() {
         try {
             if (!connected) {
                 connect();
diff --git a/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java b/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
index e00bcab..b01a20a 100644
--- a/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
+++ b/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
@@ -265,25 +265,12 @@
      */
     @Override
     public int getContentLength() {
-        long length = getContentLengthLong();
-        return length > Integer.MAX_VALUE ? -1 : (int) length;
-    }
-
-    /**
-     * Returns the content length of the resource. Test cases reveal that if the URL is referring to
-     * a Jar file, this method answers a content-length returned by URLConnection. For a jar entry
-     * it should return the entry's size. Otherwise, it will return -1.
-     *
-     * @hide Until ready for a public API change
-     */
-    @Override
-    public long getContentLengthLong() {
         try {
             connect();
             if (jarEntry == null) {
-                return jarFileURLConnection.getContentLengthLong();
+                return jarFileURLConnection.getContentLength();
             }
-            return getJarEntry().getSize();
+            return (int) getJarEntry().getSize();
         } catch (IOException e) {
             // Ignored
         }
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
index d3da174..d52b033 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
@@ -484,20 +484,6 @@
         fileURLCon.getInputStream().close();
     }
 
-    /**
-     * {@link java.net.URLConnection#getContentLengthLong()}
-     */
-    public void test_getContentLengthLong() throws Exception {
-        assertEquals(testString.getBytes().length, fileURLCon.getContentLengthLong());
-        assertEquals(Support_TestWebData.test1.length, uc.getContentLengthLong());
-        assertEquals(Support_TestWebData.test2.length, uc2.getContentLengthLong());
-
-        assertTrue(jarURLCon.getContentLength() > 0);
-        assertTrue(gifURLCon.getContentLength() > 0);
-
-        fileURLCon.getInputStream().close();
-    }
-
     public void test_getContentType() throws Exception {
         assertTrue("getContentType failed: " + fileURLCon.getContentType(),
                 fileURLCon.getContentType().contains("text/plain"));
@@ -772,39 +758,6 @@
     }
 
     /**
-     * {@link java.net.URLConnection#getHeaderFieldLong(String, long)}
-     */
-    public void test_getHeaderFieldLong() throws IOException, ParseException {
-        // Test getHeaderFieldLong() can read an int value.
-        Support_TestWebData params0 = Support_TestWebData.testParams[0];
-        long hf = uc.getHeaderFieldLong("Content-Length", Long.MIN_VALUE);
-        assertEquals(params0.testLength, hf);
-
-        // Test getHeaderFieldLong() for a value outside of the range of int.
-        Support_TestWebData params2 = Support_TestWebData.testParams[2];
-        hf = uc3.getHeaderFieldLong("Content-Length", Long.MIN_VALUE);
-        assertEquals(params2.testLength, hf);
-
-        // The remaining fields should be invalid or missing. Confirm the default is returned.
-        hf = uc3.getHeaderFieldLong("Content-Encoding", Long.MIN_VALUE);
-        assertEquals(Long.MIN_VALUE, hf);
-        hf = uc3.getHeaderFieldInt("Content-Type", Integer.MIN_VALUE);
-        assertEquals(Integer.MIN_VALUE, hf);
-        hf = uc3.getHeaderFieldInt("Date", Integer.MIN_VALUE);
-        assertEquals(Integer.MIN_VALUE, hf);
-        hf = uc3.getHeaderFieldInt("Expires", Integer.MIN_VALUE);
-        assertEquals(Integer.MIN_VALUE, hf);
-        hf = uc3.getHeaderFieldInt("SERVER", Integer.MIN_VALUE);
-        assertEquals(Integer.MIN_VALUE, hf);
-        hf = uc3.getHeaderFieldInt("Last-Modified", Integer.MIN_VALUE);
-        assertEquals(Integer.MIN_VALUE, hf);
-        hf = uc3.getHeaderFieldInt("accept-ranges", Integer.MIN_VALUE);
-        assertEquals(Integer.MIN_VALUE, hf);
-        hf = uc3.getHeaderFieldInt("DoesNotExist", Integer.MIN_VALUE);
-        assertEquals(Integer.MIN_VALUE, hf);
-    }
-
-    /**
      * {@link java.net.URLConnection#getHeaderField(java.lang.String)}
      */
     public void test_getHeaderFieldLjava_lang_String() {