summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/ByteArrayBuilder.java
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-06-19 15:03:46 -0700
committerGrace Kloba <klobag@google.com>2009-06-19 15:09:34 -0700
commit3af8e9389e008c0076b86cc6b3c6f005e7473d10 (patch)
tree84acce43fa9a460e2d888cea9df28b0bbe1ec5ee /core/java/android/webkit/ByteArrayBuilder.java
parent5254657540b0a6ad54be6229b68fa5626e4ef9e5 (diff)
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.
Diffstat (limited to 'core/java/android/webkit/ByteArrayBuilder.java')
-rw-r--r--core/java/android/webkit/ByteArrayBuilder.java15
1 files changed, 15 insertions, 0 deletions
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<Chunk> 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) {