本文整理汇总了Java中android.os.Parcel.readByteArray方法的典型用法代码示例。如果您正苦于以下问题:Java Parcel.readByteArray方法的具体用法?Java Parcel.readByteArray怎么用?Java Parcel.readByteArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.Parcel
的用法示例。
在下文中一共展示了Parcel.readByteArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
public void readFromParcel(Parcel in){
String tit = in.readString();
if (tit == null || tit.isEmpty()) {
throw new IllegalArgumentException("El titulo no puede ser nulo ni vacio"); //$NON-NLS-1$
}
this.title = tit;
this.promoter = in.readString();
this.banner = new byte[in.readInt()];
in.readByteArray(this.banner);
this.initDate = (Date) in.readSerializable();
this.endDate = (Date) in.readSerializable();
this.numRequiredSignatures = in.readInt();
this.id = in.readInt();
try {
this.promoterUrl = new URL(in.readString());
} catch (MalformedURLException e) {
e.printStackTrace();
}
this.numActualSignatures = in.readInt();
this.howtoSolveAsHtml = in.readString();
}
示例2: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
public MeshElementInfo createFromParcel(Parcel in) {
MeshElementInfo eltInfo = new MeshElementInfo();
int n;
byte[] tmp;
n = in.readInt();
tmp = new byte[n];
in.readByteArray(tmp);
eltInfo.mMids = byteArrayToShortArray(tmp);
n = in.readInt();
eltInfo.mVmids = new int[n];
in.readIntArray(eltInfo.mVmids);
return eltInfo;
}
示例3: readFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
protected void readFromParcel(Parcel parcel) {
super.readFromParcel(parcel);
this.fileName = parcel.readString();
int len = parcel.readInt();
this.dexFile = new byte[len];
parcel.readByteArray(this.dexFile);
}
示例4: IdentityKeyParcelable
import android.os.Parcel; //导入方法依赖的package包/类
public IdentityKeyParcelable(Parcel in) throws InvalidKeyException {
int serializedLength = in.readInt();
byte[] serialized = new byte[serializedLength];
in.readByteArray(serialized);
this.identityKey = new IdentityKey(serialized, 0);
}
示例5: MasterSecret
import android.os.Parcel; //导入方法依赖的package包/类
private MasterSecret(Parcel in) {
byte[] encryptionKeyBytes = new byte[in.readInt()];
in.readByteArray(encryptionKeyBytes);
byte[] macKeyBytes = new byte[in.readInt()];
in.readByteArray(macKeyBytes);
this.encryptionKey = new SecretKeySpec(encryptionKeyBytes, "AES");
this.macKey = new SecretKeySpec(macKeyBytes, "HmacSHA1");
// SecretKeySpec does an internal copy in its constructor.
Arrays.fill(encryptionKeyBytes, (byte) 0x00);
Arrays.fill(macKeyBytes, (byte)0x00);
}
示例6: User
import android.os.Parcel; //导入方法依赖的package包/类
private User(Parcel parcel) {
this.id = parcel.readLong();
this.username = parcel.readString();
this.password = parcel.readString();
this.salt = new byte[parcel.readInt()];
parcel.readByteArray(this.salt);
this.cryptoKey = new byte[parcel.readInt()];
parcel.readByteArray(this.cryptoKey);
this.cryptoKey_iv = new byte[parcel.readInt()];
parcel.readByteArray(this.cryptoKey_iv);
this.createdAt = new Date(parcel.readLong());
this.passwordNotHashed = parcel.readString();
}
示例7: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public ByteArrayDataPacket createFromParcel(Parcel in) {
Map<String, String> attributes = new HashMap<>();
int numAttributes = in.readInt();
for (int i = 0; i < numAttributes; i++) {
attributes.put(in.readString(), in.readString());
}
byte[] data = new byte[in.readInt()];
if (data.length > 0) {
in.readByteArray(data);
}
return new ByteArrayDataPacket(attributes, data);
}
示例8: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
public MeshDeviceInfo createFromParcel(Parcel in) {
MeshDeviceInfo devInfo = new MeshDeviceInfo();
byte[] tmp = new byte[2];
in.readByteArray(tmp);
devInfo.mCid = (short)(((short)tmp[0]) | (((short)tmp[1]) << 8));
in.readByteArray(tmp);
devInfo.mVid = (short)(((short)tmp[0]) | (((short)tmp[1]) << 8));
in.readByteArray(tmp);
devInfo.mPid = (short)(((short)tmp[0]) | (((short)tmp[1]) << 8));
return devInfo;
}
示例9: readFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
private void readFromParcel(Parcel in)
{
timeStamp = in.readLong();
frameSize = in.readInt();
frameBytesData = new byte[frameSize];
in.readByteArray(frameBytesData);
cachePath = in.readString();
}
示例10: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public Credential createFromParcel(Parcel source) {
int encodedLength = source.readInt();
byte[] encodedBytes = new byte[encodedLength];
source.readByteArray(encodedBytes);
try {
return Credential.fromProtoBytes(encodedBytes);
} catch (MalformedDataException ex) {
throw new IllegalStateException("Unable to decode credential proto", ex);
}
}
示例11: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public Hint createFromParcel(Parcel source) {
int length = source.readInt();
byte[] hintBytes = new byte[length];
source.readByteArray(hintBytes);
try {
return Hint.fromProtobufBytes(hintBytes);
} catch (MalformedDataException ex) {
throw new IllegalArgumentException("Unable to parse hint from parcel", ex);
}
}
示例12: getInetAddressFrom
import android.os.Parcel; //导入方法依赖的package包/类
private InetAddress getInetAddressFrom(Parcel in) {
byte[] addr = new byte[in.readInt()];
in.readByteArray(addr);
try {
return InetAddress.getByAddress(addr);
} catch (UnknownHostException e) {
e.printStackTrace();
return null;
}
}
示例13: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public PasswordSpecification createFromParcel(Parcel parcel) {
int encodedSize = parcel.readInt();
byte[] encoded = new byte[encodedSize];
parcel.readByteArray(encoded);
Protobufs.PasswordSpecification proto;
try {
proto = Protobufs.PasswordSpecification.parseFrom(encoded);
return PasswordSpecification.fromProtobuf(proto);
} catch (IOException | MalformedDataException ex) {
throw new IllegalStateException("Unable to read proto from parcel", ex);
}
}
示例14: createFromParcel
import android.os.Parcel; //导入方法依赖的package包/类
@Override
public QueryResponse createFromParcel(Parcel source) {
String responderPackage = source.readString();
long responseId = source.readLong();
byte[] responseMessage = null;
if (source.readInt() != 0) {
int responseMessageSize = source.readInt();
responseMessage = new byte[responseMessageSize];
source.readByteArray(responseMessage);
}
return new QueryResponse(responderPackage, responseId, responseMessage);
}
示例15: Output
import android.os.Parcel; //导入方法依赖的package包/类
private Output(final Parcel in) {
amount = (Coin) in.readSerializable();
final int programLength = in.readInt();
final byte[] program = new byte[programLength];
in.readByteArray(program);
script = new Script(program);
}