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


Java Parcel.createByteArray方法代碼示例

本文整理匯總了Java中android.os.Parcel.createByteArray方法的典型用法代碼示例。如果您正苦於以下問題:Java Parcel.createByteArray方法的具體用法?Java Parcel.createByteArray怎麽用?Java Parcel.createByteArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.os.Parcel的用法示例。


在下文中一共展示了Parcel.createByteArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createFromParcel

import android.os.Parcel; //導入方法依賴的package包/類
public SMimeDecryptionResult createFromParcel(final Parcel source) {
    int version = source.readInt(); // parcelableVersion
    int parcelableSize = source.readInt();
    int startPosition = source.dataPosition();

    int result = source.readInt();
    byte[] sessionKey = version > 1 ? source.createByteArray() : null;
    byte[] decryptedSessionKey = version > 1 ? source.createByteArray() : null;

    SMimeDecryptionResult vr = new SMimeDecryptionResult(result, sessionKey, decryptedSessionKey);

    // skip over all fields added in future versions of this parcel
    source.setDataPosition(startPosition + parcelableSize);

    return vr;
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:17,代碼來源:SMimeDecryptionResult.java

示例2: createFromParcel

import android.os.Parcel; //導入方法依賴的package包/類
public OpenPgpDecryptionResult createFromParcel(final Parcel source) {
    int version = source.readInt(); // parcelableVersion
    int parcelableSize = source.readInt();
    int startPosition = source.dataPosition();

    int result = source.readInt();
    byte[] sessionKey = version > 1 ? source.createByteArray() : null;
    byte[] decryptedSessionKey = version > 1 ? source.createByteArray() : null;

    OpenPgpDecryptionResult vr = new OpenPgpDecryptionResult(result, sessionKey, decryptedSessionKey);

    // skip over all fields added in future versions of this parcel
    source.setDataPosition(startPosition + parcelableSize);

    return vr;
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:17,代碼來源:OpenPgpDecryptionResult.java

示例3: createFromParcel

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public ConnectionDescriptor createFromParcel(Parcel in) {
    try {
        return new ConnectionDescriptor(in.createByteArray());
      } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
 
開發者ID:mDL-ILP,項目名稱:mDL-ILP,代碼行數:9,代碼來源:ConnectionDescriptor.java

示例4: VoiceMessage

import android.os.Parcel; //導入方法依賴的package包/類
protected VoiceMessage(Parcel in) {
    super(in);
    duration = in.readInt();
    waveform = in.createByteArray();
    linkOgg = in.readString();
    linkMp3 = in.readString();
}
 
開發者ID:PhoenixDevTeam,項目名稱:Phoenix-for-VK,代碼行數:8,代碼來源:VoiceMessage.java

示例5: AlarmCommand

import android.os.Parcel; //導入方法依賴的package包/類
protected AlarmCommand(Parcel in) {
    this.text = in.readString();
    this.vibrationPattern = in.createLongArray();
    this.backgroundBitmap = in.createByteArray();
    this.icon = in.createByteArray();
    this.snoozeDuration = in.readInt();
    this.doNotVibrateInTheater = in.readByte() != 0;
    this.doNotVibrateOnCharger = in.readByte() != 0;
}
 
開發者ID:matejdro,項目名稱:WearVibrationCenter,代碼行數:10,代碼來源:AlarmCommand.java

示例6: BitmapWrapper

import android.os.Parcel; //導入方法依賴的package包/類
protected BitmapWrapper(Parcel in) {
    byte[] bytes = in.createByteArray();
    mBitmap = BitmapFactory.decodeByteArray(
            bytes,
            0,
            bytes.length);
}
 
開發者ID:livefront,項目名稱:bridge,代碼行數:8,代碼來源:BitmapWrapper.java

示例7: QNBleDevice

import android.os.Parcel; //導入方法依賴的package包/類
protected QNBleDevice(Parcel in) {
    this.mac = in.readString();
    this.deviceName = in.readString();
    this.rssi = in.readInt();
    this.record = in.createByteArray();
    this.device = (BluetoothDevice) in.readParcelable(BluetoothDevice.class.getClassLoader());
    this.model = in.readString();
    this.method = in.readInt();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:10,代碼來源:QNBleDevice.java

示例8: BeaconDevice

import android.os.Parcel; //導入方法依賴的package包/類
private BeaconDevice(Parcel in) {
    this.bluetoothDevice = in.readParcelable(BluetoothDevice.class.getClassLoader());
    this.rssi = in.readInt();
    this.scanRecord = in.createByteArray();
    this.deviceName = in.readString();
    this.iBeacon = in.readParcelable(IBeacon.class.getClassLoader());
    this.lastUpdatedTimeMillis = in.readLong();
}
 
開發者ID:RockyQu,項目名稱:BluetoothKit,代碼行數:9,代碼來源:BeaconDevice.java

示例9: for

import android.os.Parcel; //導入方法依賴的package包/類
@SuppressWarnings("ResourceType")
/* package */ Format(Parcel in) {
  id = in.readString();
  containerMimeType = in.readString();
  sampleMimeType = in.readString();
  codecs = in.readString();
  bitrate = in.readInt();
  maxInputSize = in.readInt();
  width = in.readInt();
  height = in.readInt();
  frameRate = in.readFloat();
  rotationDegrees = in.readInt();
  pixelWidthHeightRatio = in.readFloat();
  boolean hasProjectionData = in.readInt() != 0;
  projectionData = hasProjectionData ? in.createByteArray() : null;
  stereoMode = in.readInt();
  colorInfo = in.readParcelable(ColorInfo.class.getClassLoader());
  channelCount = in.readInt();
  sampleRate = in.readInt();
  pcmEncoding = in.readInt();
  encoderDelay = in.readInt();
  encoderPadding = in.readInt();
  selectionFlags = in.readInt();
  language = in.readString();
  accessibilityChannel = in.readInt();
  subsampleOffsetUs = in.readLong();
  int initializationDataSize = in.readInt();
  initializationData = new ArrayList<>(initializationDataSize);
  for (int i = 0; i < initializationDataSize; i++) {
    initializationData.add(in.createByteArray());
  }
  drmInitData = in.readParcelable(DrmInitData.class.getClassLoader());
  metadata = in.readParcelable(Metadata.class.getClassLoader());
}
 
開發者ID:sanjaysingh1990,項目名稱:Exoplayer2Radio,代碼行數:35,代碼來源:Format.java

示例10: EventMessage

import android.os.Parcel; //導入方法依賴的package包/類
EventMessage(Parcel in) {
  schemeIdUri = in.readString();
  value = in.readString();
  durationMs = in.readLong();
  id = in.readLong();
  messageData = in.createByteArray();
}
 
開發者ID:sanjaysingh1990,項目名稱:Exoplayer2Radio,代碼行數:8,代碼來源:EventMessage.java

示例11: ApicFrame

import android.os.Parcel; //導入方法依賴的package包/類
ApicFrame(Parcel in) {
  super(ID);
  mimeType = in.readString();
  description = in.readString();
  pictureType = in.readInt();
  pictureData = in.createByteArray();
}
 
開發者ID:sanjaysingh1990,項目名稱:Exoplayer2Radio,代碼行數:8,代碼來源:ApicFrame.java

示例12: GeobFrame

import android.os.Parcel; //導入方法依賴的package包/類
GeobFrame(Parcel in) {
  super(ID);
  mimeType = in.readString();
  filename = in.readString();
  description = in.readString();
  data = in.createByteArray();
}
 
開發者ID:sanjaysingh1990,項目名稱:Exoplayer2Radio,代碼行數:8,代碼來源:GeobFrame.java

示例13:

import android.os.Parcel; //導入方法依賴的package包/類
@SuppressWarnings("ResourceType")
/* package */ ColorInfo(Parcel in) {
  colorSpace = in.readInt();
  colorRange = in.readInt();
  colorTransfer = in.readInt();
  boolean hasHdrStaticInfo = in.readInt() != 0;
  hdrStaticInfo = hasHdrStaticInfo ? in.createByteArray() : null;
}
 
開發者ID:sanjaysingh1990,項目名稱:Exoplayer2Radio,代碼行數:9,代碼來源:ColorInfo.java

示例14: AutocryptPeerUpdate

import android.os.Parcel; //導入方法依賴的package包/類
private AutocryptPeerUpdate(Parcel source, int version) {
    this.keyData = source.createByteArray();
    this.effectiveDate = source.readInt() != 0 ? new Date(source.readLong()) : null;
    this.preferEncrypt = PreferEncrypt.values()[source.readInt()];
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:6,代碼來源:AutocryptPeerUpdate.java

示例15: processSolicited

import android.os.Parcel; //導入方法依賴的package包/類
private int processSolicited(Parcel p) {
    Integer token = null;
    byte responseData[] = null;
    String stringsResponseData[] = null;
    Exception errorEx = null;

    try {
        token = p.readInt();
        int err = p.readInt();

        if (DBG) {
            Log.i(TAG, mTAG + String.format(Locale.US, ": processSolicited() token: 0x%X err: %d", token, err));
        }

        if (err != RIL_CLIENT_ERR_SUCCESS) {
            throw new RemoteException("remote error " + err);
        }

        responseData = p.createByteArray();
        stringsResponseData = p.createStringArray();

    } catch (Exception ex) {
       Log.e(TAG, mTAG + ex.getMessage());
        errorEx = ex;
    }

    if (token == null) {
       Log.e(TAG, mTAG + "token is null", errorEx);
    } else {
        synchronized (this) {
            Message m = mMessages.remove(token);

            if (m != null) {
                switch (m.what) {
                    case ID_REQUEST_AT_COMMAND:
                    case ID_RESPONSE_AT_COMMAND:
                    case RIL_REQUEST_OEM_STRINGS:
                        m.obj = new StringsResult(stringsResponseData, errorEx);
                        m.sendToTarget();
                        break;
                    default:
                        m.obj = new RawResult(responseData, errorEx);
                        m.sendToTarget();
                }
            } else {
                Log.i(TAG, mTAG + "Message with token " + token + " not found");
            }
        }
    }
    return RIL_CLIENT_ERR_SUCCESS;
}
 
開發者ID:5GSD,項目名稱:AIMSICDL,代碼行數:52,代碼來源:SamsungMulticlientRilExecutor.java


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