Skip to content

Commit

Permalink
yoyiyi
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyiyi committed Jul 25, 2017
1 parent 04e839c commit a024eb8
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* 描述:cookie序列化
*/

public class SerializableCookie implements Serializable{
public class SerializableCookie implements Serializable {
private static final String TAG = "SerializableCookie";

private static final long serialVersionUID = 6374381323722046732L;
Expand All @@ -33,8 +33,8 @@ public class SerializableCookie implements Serializable{
public String host;
public String name;
public String domain;
private transient Cookie cookie;
private transient Cookie clientCookie;
private transient Cookie cookie;//不让其序列化
private transient Cookie clientCookie;//不让其序列化

public SerializableCookie(String host, Cookie cookie) {
this.cookie = cookie;
Expand Down Expand Up @@ -138,6 +138,12 @@ public static Cookie decodeCookie(String cookieString) {
return bytesToCookie(bytes);
}

/**
* 将byte数组反序列化成cookies
*
* @param bytes
* @return
*/
public static Cookie bytesToCookie(byte[] bytes) {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
Cookie cookie = null;
Expand Down

0 comments on commit a024eb8

Please sign in to comment.