当前位置: 首页>>代码示例>>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;未经允许,请勿转载。