android.os.Parcel#writeByteArray ( )源码实例Demo

下面列出了android.os.Parcel#writeByteArray ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openpgp-api   文件: OpenPgpDecryptionResult.java
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);
}
 
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(uuid);
    dest.writeByte((byte) (isConfigured ? 1 : 0));
    dest.writeString(nodeName);
    dest.writeList(mAddedNetKeys);
    dest.writeByteArray(mFlags);
    dest.writeInt(unicastAddress);
    dest.writeByteArray(deviceKey);
    dest.writeValue(ttl);
    dest.writeInt(sequenceNumber);
    dest.writeValue(companyIdentifier);
    dest.writeValue(productIdentifier);
    dest.writeValue(versionIdentifier);
    dest.writeValue(crpl);
    dest.writeValue(nodeFeatures);
    dest.writeMap(mElements);
    dest.writeList(mAddedAppKeys);
    dest.writeLong(mTimeStampInMillis);
    dest.writeParcelable(mSeqAuth, flags);
    dest.writeValue(secureNetworkBeaconSupported);
    dest.writeParcelable(networkTransmitSettings, flags);
    dest.writeParcelable(relaySettings, flags);
    dest.writeInt((blackListed ? 1 : 0));
}
 
源代码3 项目: TvAppRepo   文件: AdvancedOptions.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(mCustomLabel);
    dest.writeString(mCategory);
    dest.writeString(mIconUrl);
    dest.writeString(mBannerUrl);
    dest.writeByte((byte) (mUnique ? 1 : 0));
    dest.writeString(mIntentUri);
    if (mIconData == null) {
        mIconData = new byte[0];
    }
    if (mBannerData == null) {
        mBannerData = new byte[0];
    }
    dest.writeInt(mIconData.length);
    dest.writeByteArray(mIconData);
    dest.writeInt(mBannerData.length);
    dest.writeByteArray(mBannerData);
}
 
源代码4 项目: android_9.0.0_r45   文件: ScanResult.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    if (mDevice != null) {
        dest.writeInt(1);
        mDevice.writeToParcel(dest, flags);
    } else {
        dest.writeInt(0);
    }
    if (mScanRecord != null) {
        dest.writeInt(1);
        dest.writeByteArray(mScanRecord.getBytes());
    } else {
        dest.writeInt(0);
    }
    dest.writeInt(mRssi);
    dest.writeLong(mTimestampNanos);
    dest.writeInt(mEventType);
    dest.writeInt(mPrimaryPhy);
    dest.writeInt(mSecondaryPhy);
    dest.writeInt(mAdvertisingSid);
    dest.writeInt(mTxPower);
    dest.writeInt(mPeriodicAdvertisingInterval);
}
 
源代码5 项目: TelePlus-Android   文件: EventMessage.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(schemeIdUri);
  dest.writeString(value);
  dest.writeLong(presentationTimeUs);
  dest.writeLong(durationMs);
  dest.writeLong(id);
  dest.writeByteArray(messageData);
}
 
源代码6 项目: FairEmail   文件: AutocryptPeerUpdate.java
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.writeByteArray(keyData);
    if (effectiveDate != null) {
        dest.writeInt(1);
        dest.writeLong(effectiveDate.getTime());
    } else {
        dest.writeInt(0);
    }

    dest.writeInt(preferEncrypt.ordinal());

    // Go back and write the size
    int parcelableSize = dest.dataPosition() - startPosition;
    dest.setDataPosition(sizePosition);
    dest.writeInt(parcelableSize);
    dest.setDataPosition(startPosition + parcelableSize);
}
 
源代码7 项目: MediaSDK   文件: DrmInitData.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeLong(uuid.getMostSignificantBits());
  dest.writeLong(uuid.getLeastSignificantBits());
  dest.writeString(licenseServerUrl);
  dest.writeString(mimeType);
  dest.writeByteArray(data);
}
 
源代码8 项目: AutoTest   文件: NetworkResponseEntity.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.message);
    dest.writeString(this.url);
    dest.writeInt(this.code);
    dest.writeByte(this.isRedirect ? (byte) 1 : (byte) 0);
    dest.writeByte(this.isSuccessful ? (byte) 1 : (byte) 0);
    dest.writeByte(this.isHttps ? (byte) 1 : (byte) 0);
    dest.writeString(this.protocol);
    dest.writeString(this.method);
    dest.writeString(this.headers);
    dest.writeByteArray(this.content);
}
 
源代码9 项目: MediaSDK   文件: EventMessage.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(schemeIdUri);
  dest.writeString(value);
  dest.writeLong(durationMs);
  dest.writeLong(id);
  dest.writeByteArray(messageData);
}
 
源代码10 项目: MediaSDK   文件: PictureFrame.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(pictureType);
  dest.writeString(mimeType);
  dest.writeString(description);
  dest.writeInt(width);
  dest.writeInt(height);
  dest.writeInt(depth);
  dest.writeInt(colors);
  dest.writeByteArray(pictureData);
}
 
源代码11 项目: AndroidChromium   文件: ChromeBrowserProvider.java
private void writeNodeContents(Parcel dest) {
    dest.writeLong(mId);
    dest.writeString(mName);
    dest.writeString(mUrl);
    dest.writeInt(mType.ordinal());
    dest.writeByteArray(mFavicon);
    dest.writeByteArray(mThumbnail);
    dest.writeLong(mParent != null ? mParent.mId : INVALID_BOOKMARK_ID);
}
 
源代码12 项目: OpenYOLO-Android   文件: QueryResponse.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(responderPackage);
    dest.writeLong(responseId);
    dest.writeInt(responseMessage != null ? 1 : 0);

    if (responseMessage != null) {
        dest.writeInt(responseMessage.length);
        dest.writeByteArray(responseMessage);
    }
}
 
源代码13 项目: TelePlus-Android   文件: GeobFrame.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(mimeType);
  dest.writeString(filename);
  dest.writeString(description);
  dest.writeByteArray(data);
}
 
源代码14 项目: Telegram-FOSS   文件: MdtaMetadataEntry.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(key);
  dest.writeInt(value.length);
  dest.writeByteArray(value);
  dest.writeInt(localeIndicator);
  dest.writeInt(typeIndicator);
}
 
源代码15 项目: Telegram-FOSS   文件: ColorInfo.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeInt(colorSpace);
  dest.writeInt(colorRange);
  dest.writeInt(colorTransfer);
  Util.writeBoolean(dest, hdrStaticInfo != null);
  if (hdrStaticInfo != null) {
    dest.writeByteArray(hdrStaticInfo);
  }
}
 
源代码16 项目: android_9.0.0_r45   文件: OperationResult.java
@Override
public void writeToParcel(Parcel out, int flags) {
    out.writeInt(resultCode);
    out.writeStrongBinder(token);
    out.writeLong(operationHandle);
    out.writeInt(inputConsumed);
    out.writeByteArray(output);
    outParams.writeToParcel(out, flags);
}
 
源代码17 项目: Telegram   文件: EventMessage.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(schemeIdUri);
  dest.writeString(value);
  dest.writeLong(durationMs);
  dest.writeLong(id);
  dest.writeByteArray(messageData);
}
 
源代码18 项目: android-nfc-lib   文件: TestUtilities.java
public Tag mockTag(String technology) throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
    // For future reference

    // Parameters :
    byte[] b = {0x8};
    String ndefClass = "android.nfc.tech.Ndef";

    // FieldName which marks the capacity of the tag
    String extraNdefMaxlength = (String) Class.forName(ndefClass).getField("EXTRA_NDEF_MAXLENGTH").get(null);

    // FieldName which marks the tags writability
    String cardWritableStateField = (String) Class.forName(ndefClass).getField("EXTRA_NDEF_CARDSTATE").get(null);

    // Field to mark tag R/W
    int cardWritable = Class.forName(ndefClass).getField("NDEF_MODE_READ_WRITE").getInt(null);

    Bundle techExtras = new Bundle();

    techExtras.putInt(extraNdefMaxlength, 2048);
    techExtras.putInt(cardWritableStateField, cardWritable);
    Bundle[] extras = {techExtras};
    int[] technologies = {TagTechnology.class.getField(technology.toUpperCase()).getInt(null)}; //https://android.googlesource.com/platform/frameworks/base.git/+/android-4.3_r2/core/java/android/nfc/tech/TagTechnology.java


    // https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/nfc/Tag.java :376
    Parcel parcel = Parcel.obtain();

    parcel.writeByteArray(b); //Sets the ID
    parcel.writeIntArray(technologies); // Sets the technology to NDEF
    parcel.writeArray(extras); // Needed to set properties for NDEF tag
    parcel.writeInt(1); // Service handle
    parcel.writeInt(1); // Indicating a mock

    return Tag.CREATOR.createFromParcel(parcel);
}
 
源代码19 项目: MediaSDK   文件: BinaryFrame.java
@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(id);
  dest.writeByteArray(data);
}
 
源代码20 项目: android_9.0.0_r45   文件: SecurityLog.java
@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeLong(mId);
    dest.writeByteArray(mEvent.getBytes());
}
 
 方法所在类
 同类方法