Code example for Parcel

Methods: writeByte, writeByteArray, writeInt

0
            return new DesfireFileSettings[size]; 
        } 
    }; 
 
    public void writeToParcel (Parcel parcel, int flags) {
        parcel.writeByte(fileType);
        parcel.writeByte(commSetting);
        parcel.writeInt(accessRights.length);
        parcel.writeByteArray(accessRights);
    } 
 
    public int describeContents () { 
        return 0; 
    } 
 
    public static class StandardDesfireFileSettings extends DesfireFileSettings { 
        public final int fileSize;
 
        private StandardDesfireFileSettings (ByteArrayInputStream stream) {
            super(stream);
            byte[] buf = new byte[3];
            stream.read(buf, 0, buf.length);
            ArrayUtils.reverse(buf);
            fileSize = Utils.byteArrayToInt(buf);
        } 
 
        StandardDesfireFileSettings (byte fileType, byte commSetting, byte[] accessRights, int fileSize) {
            super(fileType, commSetting, accessRights);
            this.fileSize = fileSize;
        } 
 
        @Override 
        public void writeToParcel (Parcel parcel, int flags) {
            super.writeToParcel(parcel, flags);
            parcel.writeInt(fileSize);
        } 
    } 
 
    public static class RecordDesfireFileSettings extends DesfireFileSettings { 
        public final int recordSize;