From 3af8e9389e008c0076b86cc6b3c6f005e7473d10 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Fri, 19 Jun 2009 15:03:46 -0700 Subject: Change addCertificate to take byte[] instead of String as we don't know the encoding. In WebView, if we run into the certificate, we will save it to the Keystore instead of sending it to the WebKit. --- core/java/android/webkit/ByteArrayBuilder.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/java/android/webkit/ByteArrayBuilder.java') diff --git a/core/java/android/webkit/ByteArrayBuilder.java b/core/java/android/webkit/ByteArrayBuilder.java index 806b458fa8c0..145411cf7a6a 100644 --- a/core/java/android/webkit/ByteArrayBuilder.java +++ b/core/java/android/webkit/ByteArrayBuilder.java @@ -17,6 +17,7 @@ package android.webkit; import java.util.LinkedList; +import java.util.ListIterator; /** Utility class optimized for accumulating bytes, and then spitting them back out. It does not optimize for returning the result in a @@ -94,6 +95,20 @@ class ByteArrayBuilder { return mChunks.isEmpty(); } + public int size() { + return mChunks.size(); + } + + public int getByteSize() { + int total = 0; + ListIterator it = mChunks.listIterator(0); + while (it.hasNext()) { + Chunk c = it.next(); + total += c.mLength; + } + return total; + } + public synchronized void clear() { Chunk c = getFirstChunk(); while (c != null) { -- cgit v1.2.3