當前位置: 首頁>>代碼示例>>Java>>正文


Java Parcel.writeByteArray方法代碼示例

本文整理匯總了Java中android.os.Parcel.writeByteArray方法的典型用法代碼示例。如果您正苦於以下問題:Java Parcel.writeByteArray方法的具體用法?Java Parcel.writeByteArray怎麽用?Java Parcel.writeByteArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.os.Parcel的用法示例。


在下文中一共展示了Parcel.writeByteArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
public void writeToParcel(Parcel dest, int flags) {
    /**
     * NOTE: When adding fields in the process of updating this API, make sure to bump
     * {@link #PARCELABLE_VERSION}.
     */
    dest.writeInt(PARCELABLE_VERSION);
    // Inject a placeholder that will store the parcel size from this point on
    // (not including the size itself).
    int sizePosition = dest.dataPosition();
    dest.writeInt(0);
    int startPosition = dest.dataPosition();
    // version 1
    dest.writeInt(result);
    // version 2
    dest.writeByteArray(sessionKey);
    dest.writeByteArray(decryptedSessionKey);
    // Go back and write the size
    int parcelableSize = dest.dataPosition() - startPosition;
    dest.setDataPosition(sizePosition);
    dest.writeInt(parcelableSize);
    dest.setDataPosition(startPosition + parcelableSize);
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:23,代碼來源:OpenPgpDecryptionResult.java

示例2: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override  
  public void writeToParcel(Parcel parcel, int flags) { 
  	byte[] tmp = new byte[2];

tmp[0] = (byte)(mCid & 0xFF);
tmp[1] = (byte)((mCid >> 8) & 0xFF);
  	parcel.writeByteArray(tmp);

tmp[0] = (byte)(mVid & 0xFF);
tmp[1] = (byte)((mVid >> 8) & 0xFF);
parcel.writeByteArray(tmp);

tmp[0] = (byte)(mPid & 0xFF);
tmp[1] = (byte)((mPid >> 8) & 0xFF);
parcel.writeByteArray(tmp);
  }
 
開發者ID:blxble,項目名稱:mesh-core-on-android,代碼行數:17,代碼來源:MeshDeviceInfo.java

示例3: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel parcel, int arg1) {
	super.writeToParcel(parcel, arg1);
	parcel.writeString(fileName);
	
	parcel.writeInt(dexFile.length);
	parcel.writeByteArray(dexFile);
}
 
開發者ID:srasthofer,項目名稱:FuzzDroid,代碼行數:9,代碼來源:DexFileTransferTraceItem.java

示例4: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(mimeType);
  dest.writeString(filename);
  dest.writeString(description);
  dest.writeByteArray(data);
}
 
開發者ID:sanjaysingh1990,項目名稱:Exoplayer2Radio,代碼行數:8,代碼來源:GeobFrame.java

示例5: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel parcel, int i) {
    super.writeToParcel(parcel, i);
    parcel.writeInt(duration);
    parcel.writeByteArray(waveform);
    parcel.writeString(linkOgg);
    parcel.writeString(linkMp3);
}
 
開發者ID:PhoenixDevTeam,項目名稱:Phoenix-for-VK,代碼行數:9,代碼來源:VoiceMessage.java

示例6: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(final Parcel dest, final int flags) {
    dest.writeSerializable(amount);

    final byte[] program = script.getProgram();
    dest.writeInt(program.length);
    dest.writeByteArray(program);
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:9,代碼來源:PaymentIntent.java

示例7: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel parcel, int flags) {
    parcel.writeLong(this.id);
    parcel.writeString(this.username);
    parcel.writeString(this.password);
    parcel.writeInt(this.salt.length);
    parcel.writeByteArray(this.salt);
    parcel.writeInt(this.cryptoKey.length);
    parcel.writeByteArray(this.cryptoKey);
    parcel.writeInt(this.cryptoKey_iv.length);
    parcel.writeByteArray(this.cryptoKey_iv);
    parcel.writeLong(this.createdAt.getTime());
    parcel.writeString(this.passwordNotHashed);
}
 
開發者ID:ProjektMedInf,項目名稱:WiFiSDCryptoLocker,代碼行數:15,代碼來源:User.java

示例8: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.text);
    dest.writeLongArray(this.vibrationPattern);
    dest.writeByteArray(this.backgroundBitmap);
    dest.writeByteArray(this.icon);
    dest.writeInt(this.snoozeDuration);
    dest.writeByte(this.doNotVibrateInTheater ? (byte) 1 : (byte) 0);
    dest.writeByte(this.doNotVibrateOnCharger ? (byte) 1 : (byte) 0);
}
 
開發者ID:matejdro,項目名稱:WearVibrationCenter,代碼行數:10,代碼來源:AlarmCommand.java

示例9: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(attributes.size());
    for (Map.Entry<String, String> entry : attributes.entrySet()) {
        dest.writeString(entry.getKey());
        dest.writeString(entry.getValue());
    }
    dest.writeInt(data.length);
    if (data.length > 0) {
        dest.writeByteArray(data);
    }
}
 
開發者ID:hortonworks,項目名稱:nifi-android-s2s,代碼行數:13,代碼來源:ByteArrayDataPacket.java

示例10: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
public static <D extends Durable> void writeToParcel(Parcel parcel, D d) {
    try {
        parcel.writeByteArray(writeToArray(d));
    } catch (IOException e) {
        throw new BadParcelableException(e);
    }
}
 
開發者ID:gigabytedevelopers,項目名稱:FireFiles,代碼行數:8,代碼來源:DurableUtils.java

示例11: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel parcel, int i) {

    parcel.writeString(this.title);
    parcel.writeString(this.promoter);
    parcel.writeInt(this.banner.length);
    parcel.writeByteArray(this.banner);
    parcel.writeSerializable(this.initDate);
    parcel.writeSerializable(this.endDate);
    parcel.writeInt(this.numRequiredSignatures);
    parcel.writeInt(this.id);
    parcel.writeString(this.promoterUrl.toString());
    parcel.writeInt(this.numActualSignatures);
    parcel.writeString(this.howtoSolveAsHtml);
}
 
開發者ID:MiFirma,項目名稱:mi-firma-android,代碼行數:16,代碼來源:Initiative.java

示例12: callMethod

import android.os.Parcel; //導入方法依賴的package包/類
public void callMethod(final String className, final String serviceName,
                       final String methodName, final Object... paramsAndListener) {
    Parcel data = Parcel.obtain();
    data.writeInterfaceToken(className);
    for (int i = 0; i < paramsAndListener.length - 1; i++) {
        Object p = paramsAndListener[i];
        if (p instanceof Byte)
            data.writeByte((Byte) p);
        else if (p instanceof Integer)
            data.writeInt((Integer) p);
        else if (p instanceof Long)
            data.writeLong((Long) p);
        else if (p instanceof String)
            data.writeString((String) p);
        else if (p instanceof Bundle)
            data.writeBundle((Bundle) p);
        else if (p instanceof Float)
            data.writeFloat((Float) p);
        else if (p instanceof FileDescriptor)
            data.writeFileDescriptor((FileDescriptor) p);
        else if (p instanceof List)
            data.writeList((List) p);
        else if (p instanceof Exception)
            data.writeException((Exception) p);
        else if (p instanceof IBinder)
            data.writeStrongBinder((IBinder) p);
        else if (p instanceof Double)
            data.writeDouble((Double) p);
        else if (p instanceof Map)
            data.writeMap((Map) p);
        else if (p instanceof boolean[])
            data.writeBooleanArray((boolean[]) p);
        else if (p instanceof byte[])
            data.writeByteArray((byte[]) p);
        else if (p instanceof char[])
            data.writeCharArray((char[]) p);
        else if (p instanceof int[])
            data.writeIntArray((int[]) p);
        else if (p instanceof IBinder[])
            data.writeBinderArray((IBinder[]) p);
        else if (p instanceof double[])
            data.writeDoubleArray((double[]) p);
        else if (p instanceof Object[])
            data.writeArray((Object[]) p);
        else data.writeValue(p);
    }

    Object lastParam = paramsAndListener[paramsAndListener.length - 1];
    CallMethodResultListener listener = lastParam == null ? null :
            (CallMethodResultListener) lastParam;

    callMethod(className, serviceName, methodName, data, listener);
    data.recycle();
}
 
開發者ID:ztc1997,項目名稱:anycall,代碼行數:55,代碼來源:Anycall.java

示例13: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(id);
  dest.writeByteArray(data);
}
 
開發者ID:sanjaysingh1990,項目名稱:Exoplayer2Radio,代碼行數:6,代碼來源:BinaryFrame.java

示例14: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel dest, int flags) {
    byte[] protoBytes = toProtocolBuffer().toByteArray();
    dest.writeInt(protoBytes.length);
    dest.writeByteArray(protoBytes);
}
 
開發者ID:openid,項目名稱:OpenYOLO-Android,代碼行數:7,代碼來源:HintRetrieveRequest.java

示例15: writeToParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(title);
    dest.writeString(description);
    dest.writeByteArray(imageDataPng);
}
 
開發者ID:matejdro,項目名稱:WearVibrationCenter,代碼行數:7,代碼來源:ReceivedNotification.java


注:本文中的android.os.Parcel.writeByteArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。