Java Code Examples for android.os.Parcel#createByteArray()

The following examples show how to use android.os.Parcel#createByteArray() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public OpenPgpDecryptionResult createFromParcel(final Parcel source) {
    int version = source.readInt(); // parcelableVersion
    int parcelableSize = source.readInt();
    int startPosition = source.dataPosition();

    int result = source.readInt();
    byte[] sessionKey = version > 1 ? source.createByteArray() : null;
    byte[] decryptedSessionKey = version > 1 ? source.createByteArray() : null;

    OpenPgpDecryptionResult vr = new OpenPgpDecryptionResult(result, sessionKey, decryptedSessionKey);

    // skip over all fields added in future versions of this parcel
    source.setDataPosition(startPosition + parcelableSize);

    return vr;
}
 
Example 2
public OpenPgpDecryptionResult createFromParcel(final Parcel source) {
    int version = source.readInt(); // parcelableVersion
    int parcelableSize = source.readInt();
    int startPosition = source.dataPosition();

    int result = source.readInt();
    byte[] sessionKey = version > 1 ? source.createByteArray() : null;
    byte[] decryptedSessionKey = version > 1 ? source.createByteArray() : null;

    OpenPgpDecryptionResult vr = new OpenPgpDecryptionResult(result, sessionKey, decryptedSessionKey);

    // skip over all fields added in future versions of this parcel
    source.setDataPosition(startPosition + parcelableSize);

    return vr;
}
 
Example 3
protected NetworkKey(Parcel in) {
    meshUuid = in.readString();
    keyIndex = in.readInt();
    name = in.readString();
    key = in.createByteArray();
    phase = in.readInt();
    minSecurity = in.readByte() != 0;
    oldKey = in.createByteArray();
    timestamp = in.readLong();
}
 
Example 4
protected OperationResult(Parcel in) {
    resultCode = in.readInt();
    token = in.readStrongBinder();
    operationHandle = in.readLong();
    inputConsumed = in.readInt();
    output = in.createByteArray();
    outParams = KeymasterArguments.CREATOR.createFromParcel(in);
}
 
Example 5
SchemeData(Parcel in) {
  uuid = new UUID(in.readLong(), in.readLong());
  licenseServerUrl = in.readString();
  mimeType = in.readString();
  data = in.createByteArray();
  requiresSecureDecryption = in.readByte() != 0;
}
 
Example 6
public BTDescriptorProfile(Parcel in) {
	UUID uuid = UUIDUtils.readFromParcel(in);
	int permissions = in.readInt();
	byte[] value = in.createByteArray();
	mDescriptor = new BluetoothGattDescriptor(uuid, permissions);
	mDescriptor.setValue(value);
}
 
Example 7
Source Project: android_9.0.0_r45   File: NetworkUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Reads an InetAddress from a parcel. Returns null if the address that was written was null
 * or if the data is invalid.
 */
protected static InetAddress unparcelInetAddress(Parcel in) {
    byte[] addressArray = in.createByteArray();
    if (addressArray == null) {
        return null;
    }
    try {
        return InetAddress.getByAddress(addressArray);
    } catch (UnknownHostException e) {
        return null;
    }
}
 
Example 8
Source Project: AppPlus   File: AppEntity.java    License: MIT License 5 votes vote down vote up
protected AppEntity(Parcel in) {
    this.id = in.readLong();
    this.appName = in.readString();
    this.packageName = in.readString();
    this.versionName = in.readString();
    this.versionCode = in.readInt();
    this.appIconData = in.createByteArray();
    this.srcPath = in.readString();
    this.uid = in.readInt();
    this.isFavorite = in.readByte() != 0;
    this.lastModifyTime = in.readLong();
    this.totalSpace = in.readLong();
    this.status = in.readInt();
}
 
Example 9
@SuppressWarnings("ResourceType")
/* package */ Format(Parcel in) {
  id = in.readString();
  label = in.readString();
  containerMimeType = in.readString();
  sampleMimeType = in.readString();
  codecs = in.readString();
  bitrate = in.readInt();
  maxInputSize = in.readInt();
  width = in.readInt();
  height = in.readInt();
  frameRate = in.readFloat();
  rotationDegrees = in.readInt();
  pixelWidthHeightRatio = in.readFloat();
  boolean hasProjectionData = Util.readBoolean(in);
  projectionData = hasProjectionData ? in.createByteArray() : null;
  stereoMode = in.readInt();
  colorInfo = in.readParcelable(ColorInfo.class.getClassLoader());
  channelCount = in.readInt();
  sampleRate = in.readInt();
  pcmEncoding = in.readInt();
  encoderDelay = in.readInt();
  encoderPadding = in.readInt();
  selectionFlags = in.readInt();
  language = in.readString();
  accessibilityChannel = in.readInt();
  subsampleOffsetUs = in.readLong();
  int initializationDataSize = in.readInt();
  initializationData = new ArrayList<>(initializationDataSize);
  for (int i = 0; i < initializationDataSize; i++) {
    initializationData.add(in.createByteArray());
  }
  drmInitData = in.readParcelable(DrmInitData.class.getClassLoader());
  metadata = in.readParcelable(Metadata.class.getClassLoader());
}
 
Example 10
SchemeData(Parcel in) {
  uuid = new UUID(in.readLong(), in.readLong());
  licenseServerUrl = in.readString();
  mimeType = Util.castNonNull(in.readString());
  data = in.createByteArray();
  requiresSecureDecryption = in.readByte() != 0;
}
 
Example 11
protected StructMessageInfo(Parcel in) {
    //this.view = in.readParcelable(View.class.getClassLoader());
    this.roomId = in.readLong();
    this.messageID = in.readString();
    this.senderID = in.readString();
    this.senderColor = in.readString();
    this.isEdited = in.readByte() != 0;
    this.status = in.readString();
    this.initials = in.readString();
    int tmpMessageType = in.readInt();
    this.messageType = tmpMessageType == -1 ? null : ProtoGlobal.RoomMessageType.values()[tmpMessageType];
    int tmpSendType = in.readInt();
    this.sendType = tmpSendType == -1 ? null : MyType.SendType.values()[tmpSendType];
    this.replayTo = Parcels.unwrap(in.readParcelable(RealmRoomMessage.class.getClassLoader()));
    this.forwardedFrom = Parcels.unwrap(in.readParcelable(RealmRoomMessage.class.getClassLoader()));
    this.songArtist = in.readString();
    this.songLength = in.readLong();
    this.messageText = in.readString();
    this.fileMime = in.readString();
    this.filePic = in.readString();
    this.filePath = in.readString();
    this.fileHash = in.createByteArray();
    this.uploadProgress = in.readInt();
    this.attachment = in.readParcelable(StructMessageAttachment.class.getClassLoader());
    this.userInfo = in.readParcelable(StructRegisteredInfo.class.getClassLoader());
    this.senderAvatar = in.readParcelable(StructMessageAttachment.class.getClassLoader());
    this.time = in.readLong();
    /*this.voteUp = in.readInt();
    this.voteDown = in.readInt();
    this.viewsLabel = in.readInt();*/
    this.channelExtra = Parcels.unwrap(in.readParcelable(StructChannelExtra.class.getClassLoader()));
}
 
Example 12
Source Project: android_9.0.0_r45   File: RouteInfo.java    License: Apache License 2.0 5 votes vote down vote up
public RouteInfo createFromParcel(Parcel in) {
    IpPrefix dest = in.readParcelable(null);

    InetAddress gateway = null;
    byte[] addr = in.createByteArray();
    try {
        gateway = InetAddress.getByAddress(addr);
    } catch (UnknownHostException e) {}

    String iface = in.readString();
    int type = in.readInt();

    return new RouteInfo(dest, gateway, iface, type);
}
 
Example 13
InstantAppDigest(Parcel in) {
    final int digestCount = in.readInt();
    if (digestCount == -1) {
        mDigestBytes = null;
    } else {
        mDigestBytes = new byte[digestCount][];
        for (int i = 0; i < digestCount; i++) {
            mDigestBytes[i] = in.createByteArray();
        }
    }
    mDigestPrefix = in.createIntArray();
    mDigestPrefixSecure = in.createIntArray();
}
 
Example 14
Source Project: AppOpsX   File: CallerResult.java    License: MIT License 4 votes vote down vote up
protected CallerResult(Parcel in) {
    this.reply = in.createByteArray();
    this.throwable = (Throwable) in.readSerializable();
    this.returnType = (Class) in.readSerializable();
}
 
Example 15
Source Project: Android-Serialport   File: ComBean.java    License: MIT License 4 votes vote down vote up
protected ComBean(Parcel in) {
    bRec = in.createByteArray();
    sRecTime = in.readString();
    sComPort = in.readString();
}
 
Example 16
Source Project: K-Sonic   File: BinaryFrame.java    License: MIT License 4 votes vote down vote up
BinaryFrame(Parcel in) {
  super(in.readString());
  data = in.createByteArray();
}
 
Example 17
/**
 * @hide
 */
protected KeyDerivationParams(Parcel in) {
    mAlgorithm = in.readInt();
    mSalt = in.createByteArray();
    mMemoryDifficulty = in.readInt();
}
 
Example 18
/**
 * @hide
 */
protected WrappedApplicationKey(Parcel in) {
    mAlias = in.readString();
    mEncryptedKeyMaterial = in.createByteArray();
}
 
Example 19
private AutocryptPeerUpdate(Parcel source, int version) {
    this.keyData = source.createByteArray();
    this.effectiveDate = source.readInt() != 0 ? new Date(source.readLong()) : null;
    this.preferEncrypt = PreferEncrypt.values()[source.readInt()];
}
 
Example 20
Source Project: android_9.0.0_r45   File: SecurityLog.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Constructor used by Parcelable.Creator to generate SecurityEvent instances.
 * @hide
 */
/* package */ SecurityEvent(Parcel source) {
    this(source.readLong(), source.createByteArray());
}