// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.olio.communication.messages.files; import android.os.Parcel; import android.os.Parcelable; import com.olio.communication.messages.Message; import com.olio.communication.messages.MessageBuilder; import com.olio.communication.messages.MessagePayload; import com.olio.util.ALog; import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Arrays; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; // Referenced classes of package com.olio.communication.messages.files: // ChunkRequest public class FileChunk extends MessagePayload implements Serializable, Parcelable { public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() { public MessagePayload createFromParcel(Parcel parcel) { return MessagePayload.unpackParcel(parcel); } public volatile Object createFromParcel(Parcel parcel) { return createFromParcel(parcel); } public MessagePayload[] newArray(int i) { return new FileChunk[i]; } public volatile Object[] newArray(int i) { return newArray(i); } }; private static final long serialVersionUID = 7L; private byte mBytes[]; private String mFileIdentifier; private String mFileSource; private int mStartingByte; public FileChunk() { } public static Message decodeChunk(String s, byte abyte0[]) { FileChunk filechunk = new FileChunk(); ByteBuffer bytebuffer = ByteBuffer.wrap(abyte0).order(ByteOrder.LITTLE_ENDIAN); byte abyte1[] = new byte[bytebuffer.get() & 0xff]; bytebuffer.get(abyte1); try { filechunk.setFileIdentifier(new String(abyte1, "UTF-8")); } catch (UnsupportedEncodingException unsupportedencodingexception) { ALog.e("Unsupported file encoding when getting FileChunk Identifier", unsupportedencodingexception, new Object[0]); } filechunk.setStartingByte(bytebuffer.getInt()); filechunk.setFileSource(s); if (abyte0.length - bytebuffer.position() == 4) { filechunk.setBytes(null); } else { filechunk.setBytes(Arrays.copyOfRange(abyte0, bytebuffer.position(), abyte0.length)); abyte0 = new ChunkRequest(); abyte0.setFileSource(s); abyte0.setFileIdentifier(filechunk.getFileIdentifier()); abyte0.setRequestedStartingByte(filechunk.getStartingByte() + filechunk.getBytes().length); } return (new MessageBuilder()).setAction(com.olio.communication.messages.Message.Action.CREATE_OR_UPDATE).setPayload(filechunk).setDestination("watch").build(); } public static Message fileDecode(byte abyte0[]) { return null; } public boolean equals(Object obj) { if (obj != null) { if (obj == this) { return true; } if (obj.getClass() == getClass()) { FileChunk filechunk = (FileChunk)obj; return (new EqualsBuilder()).appendSuper(super.equals(obj)).append(mFileIdentifier, filechunk.mFileIdentifier).append(mStartingByte, filechunk.mStartingByte).append(mBytes, filechunk.mBytes).isEquals(); } } return false; } public byte[] getBytes() { return mBytes; } public String getFileIdentifier() { return mFileIdentifier; } public String getFileSource() { return mFileSource; } public int getStartingByte() { return mStartingByte; } public int hashCode() { return (new HashCodeBuilder(97, 61)).append(mFileIdentifier).append(mStartingByte).append(mBytes).toHashCode(); } public void setBytes(byte abyte0[]) { mBytes = abyte0; } public void setFileIdentifier(String s) { mFileIdentifier = s; } public void setFileSource(String s) { mFileSource = s; } public void setStartingByte(int i) { mStartingByte = i; } public String toString() { return (new StringBuilder()).append("FileChunk{, mFileIdentifier='").append(mFileIdentifier).append('\'').append(", mStartingByte=").append(mStartingByte).append(", mFileSource='").append(mFileSource).append('\'').append("} ").append(super.toString()).toString(); } }