private PrivateCommand(Parcel in) { ptsAdjustment = in.readLong(); identifier = in.readLong(); commandBytes = new byte[in.readInt()]; in.readByteArray(commandBytes); }
private MdtaMetadataEntry(Parcel in) { key = Util.castNonNull(in.readString()); value = new byte[in.readInt()]; in.readByteArray(value); localeIndicator = in.readInt(); typeIndicator = in.readInt(); }
@SuppressWarnings("unchecked") protected ServerResponse(Parcel in) { httpCode = in.readInt(); body = new byte[in.readInt()]; in.readByteArray(body); headers = (LinkedHashMap<String, String>) in.readSerializable(); }
int serviceDataLength = in.readInt(); byte[] serviceData = new byte[serviceDataLength]; in.readByteArray(serviceData); if (in.readInt() == 0) { builder.setServiceData(servcieDataUuid, serviceData); int serviceDataMaskLength = in.readInt(); byte[] serviceDataMask = new byte[serviceDataMaskLength]; in.readByteArray(serviceDataMask); builder.setServiceData( servcieDataUuid, serviceData, serviceDataMask); int manufacturerDataLength = in.readInt(); byte[] manufacturerData = new byte[manufacturerDataLength]; in.readByteArray(manufacturerData); if (in.readInt() == 0) { builder.setManufacturerData(manufacturerId, manufacturerData); int manufacturerDataMaskLength = in.readInt(); byte[] manufacturerDataMask = new byte[manufacturerDataMaskLength]; in.readByteArray(manufacturerDataMask); builder.setManufacturerData(manufacturerId, manufacturerData, manufacturerDataMask);
@Test public void testWriteAndReadByteArray() { byte[] bytes = new byte[] { -1, 2, 3, 127 }; parcel.writeByteArray(bytes); assertThat(parcel.dataSize()).isEqualTo(8); parcel.setDataPosition(0); byte[] actualBytes = new byte[bytes.length]; parcel.readByteArray(actualBytes); assertTrue(Arrays.equals(bytes, actualBytes)); }
@Test(expected = RuntimeException.class) public void testWriteAndReadByteArray_badLength() { byte[] bytes = new byte[] { -1, 2, 3, 127 }; parcel.writeByteArray(bytes); assertThat(parcel.dataSize()).isEqualTo(8); parcel.setDataPosition(0); byte[] actualBytes = new byte[1]; parcel.readByteArray(actualBytes); }
@Test(expected = RuntimeException.class) public void testWriteAndReadByteArray_nullNotAllowed() { parcel.writeByteArray(null); assertThat(parcel.dataSize()).isEqualTo(4); parcel.setDataPosition(0); byte[] actualBytes = new byte[1]; parcel.readByteArray(actualBytes); }
public void writeToParcel(Parcel dest, int flags) { dest.writeString(type); dest.writeString(numberPlate); dest.writeString(brand); dest.writeDouble(pricePerHour); dest.writeDouble(pricePerKm); dest.writeString(objectId); dest.writeInt(photo.length()); dest.writeByteArray(photo); } public void readFromParcel(Parcel in){ this.type = in.readString(); this.numberPlate = in.readString(); this.brand = in.readString(); this.pricePerHour = in.readDouble(); this.pricePerKm = in.readDouble(); this.objectId = in.readString(); this.photo = new byte[in.readInt()]; in.readByteArray(this.photo); }
source.readByteArray(bytes); return bytes;
@Override public void readFromParcel(Parcel in, byte[] val) { in.readByteArray(val); }
YourConstructor(Parcel in) { byte[] bytes = new byte[in.readInt()]; // read the length of the array in.readByteArray(bytes); // read bytes to array yourBundle = deserializeBundle(bytes); // unpack the bundle }
public AVIMBinaryMessage(Parcel in) { super(in); int byteLen = in.readInt(); if (byteLen <= 0) { this.bytes = null; } else { bytes = new byte[byteLen]; in.readByteArray(bytes); } } }
private NfcTagEventData(Parcel in) { id = new byte[in.readInt()]; in.readByteArray(id); } }
public static byte[] readOptBytes(Parcel source){ if (source.readByte()==1){ int size = source.readInt(); byte[] ret = new byte[size]; source.readByteArray(ret); return ret; } return null; }
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; } }
protected Property(final Parcel in) { mImage = new byte[in.readInt()]; in.readByteArray(mImage); // this will read the byte array from Parcel object(in) and store the value in mImage member variable. mId = in.readString(); mGeneralInformation = in.readParcelable(GeneralInformation.class.getClassLoader()); }
public TransitionalImage (Parcel in) { this.duration = in.readInt(); this.backgroundColor= in.readInt(); this.imageResId = in.readInt(); int imageByteArrayLength = in.readInt(); if(imageByteArrayLength > 0) { this.imageByteArray = new byte[imageByteArrayLength]; in.readByteArray(this.imageByteArray); } }
@Override public void readFromParcel(Parcel in) { super.readFromParcel(in); mBusId = in.readInt(); mId = in.readInt(); in.readByteArray(mData); }
@Override protected void readFromParcel(Parcel in) { super.readFromParcel(in); mBusId = in.readInt(); mId = in.readInt(); mMode = in.readInt(); mPid = (Integer) in.readValue(Integer.class.getClassLoader()); int payloadSize = in.readInt(); if(payloadSize > 0) { mPayload = new byte[payloadSize]; in.readByteArray(mPayload); } }
private AuthorizationRequest(Parcel source) { super(source); mPrivacyUrl = source.readString(); mUserAgreementUrl = source.readString(); mScopes = (HashSet) source.readSerializable(); mAdditionalPayloadAttributes = (HashMap) source.readSerializable(); mMsgGuid = source.readString(); mEncryptionKey = new byte[source.readInt()]; source.readByteArray(mEncryptionKey); }