當前位置: 首頁>>代碼示例>>Java>>正文


Java Parcel.readByteArray方法代碼示例

本文整理匯總了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();

    }
 
開發者ID:MiFirma,項目名稱:mi-firma-android,代碼行數:27,代碼來源:Initiative.java

示例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;
}
 
開發者ID:blxble,項目名稱:mesh-core-on-android,代碼行數:17,代碼來源:MeshElementInfo.java

示例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);
}
 
開發者ID:srasthofer,項目名稱:FuzzDroid,代碼行數:10,代碼來源:DexFileTransferTraceItem.java

示例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);
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:8,代碼來源:IdentityKeyParcelable.java

示例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);
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:15,代碼來源:MasterSecret.java

示例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();
}
 
開發者ID:ProjektMedInf,項目名稱:WiFiSDCryptoLocker,代碼行數:14,代碼來源:User.java

示例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);
}
 
開發者ID:hortonworks,項目名稱:nifi-android-s2s,代碼行數:14,代碼來源:ByteArrayDataPacket.java

示例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;
}
 
開發者ID:blxble,項目名稱:mesh-core-on-android,代碼行數:16,代碼來源:MeshDeviceInfo.java

示例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();
}
 
開發者ID:feigxj,項目名稱:VideoRecorder-master,代碼行數:9,代碼來源:SavedFrames.java

示例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);
    }
}
 
開發者ID:openid,項目名稱:OpenYOLO-Android,代碼行數:13,代碼來源:Credential.java

示例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);
    }
}
 
開發者ID:openid,項目名稱:OpenYOLO-Android,代碼行數:12,代碼來源:Hint.java

示例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;
    }
}
 
開發者ID:adroitandroid,項目名稱:Near,代碼行數:11,代碼來源:Host.java

示例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);
    }

}
 
開發者ID:openid,項目名稱:OpenYOLO-Android,代碼行數:16,代碼來源:PasswordSpecification.java

示例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);
}
 
開發者ID:openid,項目名稱:OpenYOLO-Android,代碼行數:13,代碼來源:QueryResponse.java

示例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);
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:9,代碼來源:PaymentIntent.java


注:本文中的android.os.Parcel.readByteArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。