下面列出了android.os.Parcel#readMap ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
protected PlatformInfo(Parcel in) {
this.mThirdPlatformId = in.readString();
this.mServiceVersion = in.readString();
this.mVideoId = in.readString();
this.mIdentity = in.readString();
this.videoWidth = in.readInt();
this.videoHeight = in.readInt();
this.verVideoWidth = in.readInt();
this.verVideoHeight = in.readInt();
this.mAppKey = in.readString();
this.mAppSecret = in.readString();
int tmpMInitDirection = in.readInt();
this.mDirection = tmpMInitDirection == -1 ? ScreenStatus.SMALL_VERTICAL : ScreenStatus.getStatusById(tmpMInitDirection);
this.mVideoType = tmpMInitDirection == -1 ? VideoType.VIDEOOS : VideoType.getStatusById(tmpMInitDirection);
this.mVideoCategory = in.readString();
in.readMap(this.mExtendDict,Map.class.getClassLoader());
this.mCustomerPackageName = in.readString();
this.mFileProviderAuth = in.readString();
}
protected Provider(Parcel in) {
this.mAppKey = in.readString();
this.mAppSecret = in.readString();
this.mHorVideoWidth = in.readInt();
this.mHorVideoHeight = in.readInt();
this.mVerVideoHeight = in.readInt();
this.mVerVideoWidth = in.readInt();
this.mVideoType = VideoType.getStatusById(in.readInt());
this.mVideoTitle = in.readString();
this.mVideoPath = in.readString();
this.mPlatformId = in.readString();
this.mDirection = ScreenStatus.getStatusById(in.readInt());
this.mVerticalSmallVideoHeight = in.readInt();
this.mVerticalSmallVideoWidth = in.readInt();
this.mCustomUDID = in.readString();
this.mVideoCategory = in.readString();
in.readMap(this.mExtendDict, Map.class.getClassLoader());
this.mFileProviderAuth = in.readString();
}
public void readParcel(FileInputStream fis) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
int len;
byte[] buf = new byte[1024 * 1024];
while ((len = fis.read(buf)) > 0) {
bos.write(buf, 0, len);
}
Parcel parcel = Parcel.obtain();
buf = bos.toByteArray();
parcel.unmarshall(buf, 0, buf.length);
parcel.setDataPosition(0);
//read parcel
Map<String, List<String>> map = new HashMap<>();
parcel.readMap(map, HashMap.class.getClassLoader());
parcel.recycle();
}
@Override
public State createFromParcel(Parcel in) {
final State state = new State();
state.action = in.readInt();
state.userMode = in.readInt();
state.acceptMimes = new String[in.readInt()];
in.readStringArray(state.acceptMimes);
state.userSortOrder = in.readInt();
state.allowMultiple = in.readInt() != 0;
state.showSize = in.readInt() != 0;
state.showFolderSize = in.readInt() != 0;
state.showThumbnail = in.readInt() != 0;
state.showHiddenFiles = in.readInt() != 0;
state.localOnly = in.readInt() != 0;
state.forceAdvanced = in.readInt() != 0;
state.showAdvanced = in.readInt() != 0;
state.rootMode = in.readInt() != 0;
state.stackTouched = in.readInt() != 0;
state.restored = in.readInt() != 0;
DurableUtils.readFromParcel(in, state.stack);
state.currentSearch = in.readString();
in.readMap(state.dirState, null);
return state;
}
@Override
public State createFromParcel(Parcel in) {
final State state = new State();
state.action = in.readInt();
state.userMode = in.readInt();
state.acceptMimes = new String[in.readInt()];
in.readStringArray(state.acceptMimes);
state.userSortOrder = in.readInt();
state.allowMultiple = in.readInt() != 0;
state.showSize = in.readInt() != 0;
state.showFolderSize = in.readInt() != 0;
state.showThumbnail = in.readInt() != 0;
state.showHiddenFiles = in.readInt() != 0;
state.localOnly = in.readInt() != 0;
state.forceAdvanced = in.readInt() != 0;
state.showAdvanced = in.readInt() != 0;
state.rootMode = in.readInt() != 0;
state.stackTouched = in.readInt() != 0;
state.restored = in.readInt() != 0;
DurableUtils.readFromParcel(in, state.stack);
state.currentSearch = in.readString();
in.readMap(state.dirState, null);
return state;
}
@Override
public State createFromParcel(Parcel in) {
final State state = new State();
state.action = in.readInt();
state.userMode = in.readInt();
state.acceptMimes = new String[in.readInt()];
in.readStringArray(state.acceptMimes);
state.userSortOrder = in.readInt();
state.allowMultiple = in.readInt() != 0;
state.showSize = in.readInt() != 0;
state.showFolderSize = in.readInt() != 0;
state.showThumbnail = in.readInt() != 0;
state.showHiddenFiles = in.readInt() != 0;
state.localOnly = in.readInt() != 0;
state.forceAdvanced = in.readInt() != 0;
state.showAdvanced = in.readInt() != 0;
state.rootMode = in.readInt() != 0;
state.stackTouched = in.readInt() != 0;
state.restored = in.readInt() != 0;
DurableUtils.readFromParcel(in, state.stack);
state.currentSearch = in.readString();
in.readMap(state.dirState, null);
return state;
}
private ContrastSwatch(Parcel source) {
mBackgroundColors = new LinkedList<Integer>();
mForegroundColors = new LinkedList<Integer>();
mLuminanceMap = new HashMap<Integer, Double>();
mLuminanceHistogram = new HashMap<Double, Integer>();
mName = source.readString();
source.readMap(mLuminanceMap, null);
source.readMap(mLuminanceHistogram, null);
source.readList(mBackgroundColors, null);
source.readList(mForegroundColors, null);
mBackgroundLuminance = source.readDouble();
mForegroundLuminance = source.readDouble();
mScreenBounds = (Rect) source.readValue(Rect.class.getClassLoader());
mContrastRatio = source.readDouble();
}
public PdfBitmap(Parcel in) {
// We just need to read back each
// field in the order that it was
image = in.readParcelable(Bitmap.class.getClassLoader());
height = in.readInt();
width = in.readInt();
pdfX = in.readInt();
pdfY = in.readInt();
pageNumber = in.readInt();
String typeString = in.readString();
if (typeString != null) {
type = Type.valueOf(typeString);
}
isRemovable = in.readByte() != 0;
in.readMap(metadata, HashMap.class.getClassLoader());
}
@Ignore
protected ProvisionedMeshNode(Parcel in) {
//noinspection ConstantConditions
uuid = in.readString();
isConfigured = in.readByte() != 1;
nodeName = in.readString();
in.readList(mAddedNetKeys, NodeKey.class.getClassLoader());
mFlags = in.createByteArray();
unicastAddress = in.readInt();
deviceKey = in.createByteArray();
ttl = (Integer) in.readValue(Integer.class.getClassLoader());
sequenceNumber = in.readInt();
companyIdentifier = (Integer) in.readValue(Integer.class.getClassLoader());
productIdentifier = (Integer) in.readValue(Integer.class.getClassLoader());
versionIdentifier = (Integer) in.readValue(Integer.class.getClassLoader());
crpl = (Integer) in.readValue(Integer.class.getClassLoader());
nodeFeatures = (Features) in.readValue(Features.class.getClassLoader());
in.readMap(mElements, Element.class.getClassLoader());
sortElements(mElements);
in.readList(mAddedAppKeys, NodeKey.class.getClassLoader());
mTimeStampInMillis = in.readLong();
mSeqAuth = in.readParcelable(SparseIntArrayParcelable.class.getClassLoader());
secureNetworkBeaconSupported = (Boolean) in.readValue(Boolean.class.getClassLoader());
networkTransmitSettings = in.readParcelable(NetworkTransmitSettings.class.getClassLoader());
relaySettings = in.readParcelable(RelaySettings.class.getClassLoader());
blackListed = in.readInt() != 1;
}
protected BaseShareParam(Parcel in) {
mTitle = in.readString();
mContent = in.readString();
mTargetUrl = in.readString();
try {
in.readMap(mExtraMap, Map.class.getClassLoader());
} catch (Exception e) {
e.printStackTrace();
}
}
protected CustomSearchItem(final Parcel in) {
description = in.readString();
id = in.readString();
type = in.readString();
comment = in.readString();
paymentMethodId = in.readString();
discountInfo = in.readString();
defaultAmountConfiguration = in.readString();
amountConfigurations = new HashMap<>();
in.readMap(amountConfigurations, AmountConfiguration.class.getClassLoader());
lastFourDigits = in.readString();
firstSixDigits = in.readString();
issuer = in.readParcelable(Issuer.class.getClassLoader());
escStatus = in.readString();
}
protected ExpressMetadata(final Parcel in) {
paymentMethodId = in.readString();
paymentTypeId = in.readString();
card = in.readParcelable(CardMetadata.class.getClassLoader());
accountMoney = in.readParcelable(AccountMoneyMetadata.class.getClassLoader());
consumerCredits = in.readParcelable(ConsumerCreditsMetadata.class.getClassLoader());
newCard = in.readParcelable(NewCardMetadata.class.getClassLoader());
status = in.readParcelable(StatusMetadata.class.getClassLoader());
offlineMethods = in.readParcelable(OfflinePaymentTypesMetadata.class.getClassLoader());
benefits = in.readParcelable(BenefitsMetadata.class.getClassLoader());
displayInfo = in.readParcelable(SliderDisplayInfo.class.getClassLoader());
behaviours = new HashMap<>();
in.readMap(behaviours, CheckoutBehaviour.class.getClassLoader());
}
public UserProfile(Parcel in) {
id = in.readLong();
nickname = in.readString();
thumbnailImagePath = in.readString();
profileImagePath = in.readString();
in.readMap(properties, getClass().getClassLoader());
}
protected AvailableMethod(final Parcel in) {
paymentMethodId = in.readString();
paymentMethodType = in.readString();
extraInfo = new HashMap<>();
in.readMap(extraInfo, Object.class.getClassLoader());
}
protected TransportableSensorOptions(Parcel in) {
values = new ArrayMap<>();
in.readMap(values, getClass().getClassLoader());
}
private DynamicsLink(Parcel in) {
in.readMap(link, HashMap.class.getClassLoader());
}
public SolidMap(Parcel in) {
LinkedHashMap<K, V> temp = new LinkedHashMap<>();
in.readMap(temp, CLASS_LOADER);
//noinspection unchecked
map = Collections.unmodifiableMap(temp);
}
public SimpleIdGenerator(Parcel source) {
sNextGeneratedId = new AtomicInteger(source.readInt());
source.readMap(idMap, null);
}