本文整理汇总了Java中android.os.Parcel.createByteArray方法的典型用法代码示例。如果您正苦于以下问题:Java Parcel.createByteArray方法的具体用法?Java Parcel.createByteArray怎么用?Java Parcel.createByteArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Parcel
的用法示例。
在下文中一共展示了Parcel.createByteArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
public SMimeDecryptionResult 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;
SMimeDecryptionResult vr = new SMimeDecryptionResult(result, sessionKey, decryptedSessionKey);
// skip over all fields added in future versions of this parcel
source.setDataPosition(startPosition + parcelableSize);
return vr;
}
示例2: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
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;
}
示例3: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public ConnectionDescriptor createFromParcel(Parcel in) {
try {
return new ConnectionDescriptor(in.createByteArray());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例4: VoiceMessage
import android.os.Parcel; //导入方法依赖的package包/类
protected VoiceMessage(Parcel in) {
super(in);
duration = in.readInt();
waveform = in.createByteArray();
linkOgg = in.readString();
linkMp3 = in.readString();
}
示例5: AlarmCommand
import android.os.Parcel; //导入方法依赖的package包/类
protected AlarmCommand(Parcel in) {
this.text = in.readString();
this.vibrationPattern = in.createLongArray();
this.backgroundBitmap = in.createByteArray();
this.icon = in.createByteArray();
this.snoozeDuration = in.readInt();
this.doNotVibrateInTheater = in.readByte() != 0;
this.doNotVibrateOnCharger = in.readByte() != 0;
}
示例6: BitmapWrapper
import android.os.Parcel; //导入方法依赖的package包/类
protected BitmapWrapper(Parcel in) {
byte[] bytes = in.createByteArray();
mBitmap = BitmapFactory.decodeByteArray(
bytes,
0,
bytes.length);
}
示例7: QNBleDevice
import android.os.Parcel; //导入方法依赖的package包/类
protected QNBleDevice(Parcel in) {
this.mac = in.readString();
this.deviceName = in.readString();
this.rssi = in.readInt();
this.record = in.createByteArray();
this.device = (BluetoothDevice) in.readParcelable(BluetoothDevice.class.getClassLoader());
this.model = in.readString();
this.method = in.readInt();
}
示例8: BeaconDevice
import android.os.Parcel; //导入方法依赖的package包/类
private BeaconDevice(Parcel in) {
this.bluetoothDevice = in.readParcelable(BluetoothDevice.class.getClassLoader());
this.rssi = in.readInt();
this.scanRecord = in.createByteArray();
this.deviceName = in.readString();
this.iBeacon = in.readParcelable(IBeacon.class.getClassLoader());
this.lastUpdatedTimeMillis = in.readLong();
}
示例9: for
import android.os.Parcel; //导入方法依赖的package包/类
@SuppressWarnings("ResourceType")
/* package */ Format(Parcel in) {
id = 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 = in.readInt() != 0;
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());
}
示例10: EventMessage
import android.os.Parcel; //导入方法依赖的package包/类
EventMessage(Parcel in) {
schemeIdUri = in.readString();
value = in.readString();
durationMs = in.readLong();
id = in.readLong();
messageData = in.createByteArray();
}
示例11: ApicFrame
import android.os.Parcel; //导入方法依赖的package包/类
ApicFrame(Parcel in) {
super(ID);
mimeType = in.readString();
description = in.readString();
pictureType = in.readInt();
pictureData = in.createByteArray();
}
示例12: GeobFrame
import android.os.Parcel; //导入方法依赖的package包/类
GeobFrame(Parcel in) {
super(ID);
mimeType = in.readString();
filename = in.readString();
description = in.readString();
data = in.createByteArray();
}
示例13:
import android.os.Parcel; //导入方法依赖的package包/类
@SuppressWarnings("ResourceType")
/* package */ ColorInfo(Parcel in) {
colorSpace = in.readInt();
colorRange = in.readInt();
colorTransfer = in.readInt();
boolean hasHdrStaticInfo = in.readInt() != 0;
hdrStaticInfo = hasHdrStaticInfo ? in.createByteArray() : null;
}
示例14: AutocryptPeerUpdate
import android.os.Parcel; //导入方法依赖的package包/类
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()];
}
示例15: processSolicited
import android.os.Parcel; //导入方法依赖的package包/类
private int processSolicited(Parcel p) {
Integer token = null;
byte responseData[] = null;
String stringsResponseData[] = null;
Exception errorEx = null;
try {
token = p.readInt();
int err = p.readInt();
if (DBG) {
Log.i(TAG, mTAG + String.format(Locale.US, ": processSolicited() token: 0x%X err: %d", token, err));
}
if (err != RIL_CLIENT_ERR_SUCCESS) {
throw new RemoteException("remote error " + err);
}
responseData = p.createByteArray();
stringsResponseData = p.createStringArray();
} catch (Exception ex) {
Log.e(TAG, mTAG + ex.getMessage());
errorEx = ex;
}
if (token == null) {
Log.e(TAG, mTAG + "token is null", errorEx);
} else {
synchronized (this) {
Message m = mMessages.remove(token);
if (m != null) {
switch (m.what) {
case ID_REQUEST_AT_COMMAND:
case ID_RESPONSE_AT_COMMAND:
case RIL_REQUEST_OEM_STRINGS:
m.obj = new StringsResult(stringsResponseData, errorEx);
m.sendToTarget();
break;
default:
m.obj = new RawResult(responseData, errorEx);
m.sendToTarget();
}
} else {
Log.i(TAG, mTAG + "Message with token " + token + " not found");
}
}
}
return RIL_CLIENT_ERR_SUCCESS;
}