当前位置: 首页>>代码示例>>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;未经允许,请勿转载。