Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Important fixes, the library only works on Android now.

  • Loading branch information...
commit ee7729b7f162591cfacf2fdf32f991deff95497f 1 parent 6fd0e85
Aidan Follestad authored August 13, 2012
8  src/com/teamboid/twitterapi/utilities/Utils.java
... ...
@@ -1,6 +1,6 @@
1 1
 package com.teamboid.twitterapi.utilities;
2 2
 
3  
-import org.apache.commons.codec.binary.Base64;
  3
+import android.util.Base64;
4 4
 import org.w3c.dom.Document;
5 5
 import org.xml.sax.InputSource;
6 6
 
@@ -21,7 +21,7 @@ public static String getBase64FromStream(InputStream is) throws Exception {
21 21
         copy(is, o);
22 22
 		byte[] bytes = o.toByteArray();
23 23
 		is.close();
24  
-		return Base64.encodeBase64String(bytes);
  24
+        return Base64.encodeToString(bytes, Base64.DEFAULT);
25 25
     }
26 26
 
27 27
     public static String getBase64FromFile(File file) throws Exception {
@@ -380,7 +380,7 @@ public static String stripAnchor(String str) {
380 380
 
381 381
 	public static Object deserializeObject(String input) {
382 382
 		try {
383  
-			byte[] data = Base64.decodeBase64(input);
  383
+			byte[] data = Base64.decode(input, Base64.DEFAULT);
384 384
 			ObjectInputStream ois = new ObjectInputStream( 
385 385
 					new ByteArrayInputStream(data));
386 386
 			Object o = ois.readObject();
@@ -398,7 +398,7 @@ public static String serializeObject(Serializable tweet){
398 398
 			ObjectOutputStream oos = new ObjectOutputStream(baos);
399 399
 			oos.writeObject(tweet);
400 400
 			oos.close();
401  
-			return Base64.encodeBase64String(baos.toByteArray());
  401
+			return Base64.encodeToString(baos.toByteArray(), Base64.DEFAULT);
402 402
 		} catch(Exception e){
403 403
 			e.printStackTrace();
404 404
 			return "";

0 notes on commit ee7729b

Please sign in to comment.
Something went wrong with that request. Please try again.