android.os.Parcel.writeByte()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(301)

本文整理了Java中android.os.Parcel.writeByte()方法的一些代码示例,展示了Parcel.writeByte()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parcel.writeByte()方法的具体详情如下:
包路径:android.os.Parcel
类名称:Parcel
方法名:writeByte

Parcel.writeByte介绍

[英]Write a byte value into the parcel at the current dataPosition(), growing dataCapacity() if needed.
[中]在当前dataPosition()处向包裹中写入字节值,必要时增加dataCapacity()。

代码示例

代码示例来源:origin: johncarl81/parceler

@Override
  public void nullSafeToParcel(Byte input, Parcel parcel) {
    parcel.writeByte(input);
  }
};

代码示例来源:origin: google/ExoPlayer

@Override
public void writeToParcel(Parcel dest, int flags) {
 dest.writeLong(uuid.getMostSignificantBits());
 dest.writeLong(uuid.getLeastSignificantBits());
 dest.writeString(licenseServerUrl);
 dest.writeString(mimeType);
 dest.writeByteArray(data);
 dest.writeByte((byte) (requiresSecureDecryption ? 1 : 0));
}

代码示例来源:origin: android-hacker/VirtualXposed

@Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeByte(this.launched ? (byte) 1 : (byte) 0);
    dest.writeByte(this.hidden ? (byte) 1 : (byte) 0);
    dest.writeByte(this.installed ? (byte) 1 : (byte) 0);
  }
}

代码示例来源:origin: android-hacker/VirtualXposed

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeByte((byte) (isSuccess ? 1 : 0));
  dest.writeByte((byte) (isUpdate ? 1 : 0));
  dest.writeString(packageName);
  dest.writeString(error);
}

代码示例来源:origin: android-hacker/VirtualXposed

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeByte(this.enable ? (byte) 1 : (byte) 0);
  dest.writeString(this.vsPath);
}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeByte((byte) (isLargeFile ? 1 : 0));
  dest.writeByte(getStatus());
  // normal
  dest.writeInt(this.id);
}

代码示例来源:origin: google/ExoPlayer

@Override
public void writeToParcel(Parcel dest, int flags) {
 dest.writeString(elementId);
 dest.writeByte((byte) (isRoot ? 1 : 0));
 dest.writeByte((byte) (isOrdered ? 1 : 0));
 dest.writeStringArray(children);
 dest.writeInt(subFrames.length);
 for (Id3Frame subFrame : subFrames) {
  dest.writeParcelable(subFrame, 0);
 }
}

代码示例来源:origin: vondear/RxTool

@Override
public void writeToParcel(Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeInt(facing);
  out.writeParcelable(ratio, 0);
  out.writeByte((byte) (autoFocus ? 1 : 0));
  out.writeInt(flash);
}

代码示例来源:origin: rey5137/material

@Override
public void writeToParcel(@NonNull Parcel out, int flags) {
  super.writeToParcel(out, flags);
  out.writeInt(position);
  out.writeByte((byte) (showDropdown ? 1 : 0));
}

代码示例来源:origin: android-hacker/VirtualXposed

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(this.packageName);
  dest.writeString(this.apkPath);
  dest.writeString(this.libPath);
  dest.writeByte(this.dependSystem ? (byte) 1 : (byte) 0);
  dest.writeInt(this.appId);
}

代码示例来源:origin: android-hacker/VirtualXposed

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeString(this.packageName);
  dest.writeString(this.apkPath);
  dest.writeString(this.libPath);
  dest.writeByte(this.dependSystem ? (byte) 1 : (byte) 0);
  dest.writeInt(this.appId);
  //noinspection unchecked
  dest.writeSparseArray((SparseArray) this.userState);
  dest.writeByte(this.skipDexOpt ? (byte) 1 : (byte) 0);
}

代码示例来源:origin: android-hacker/VirtualXposed

@Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeParcelable(this.filter, flags);
    dest.writeByte(this.hasDefault ? (byte) 1 : (byte) 0);
    dest.writeInt(this.labelRes);
    dest.writeString(this.nonLocalizedLabel);
    dest.writeInt(this.icon);
    dest.writeInt(this.logo);
    dest.writeInt(this.banner);
  }
}

代码示例来源:origin: pockethub/PocketHub

@Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeParcelable(repository, flags);
    dest.writeTypedList(labels);
    dest.writeParcelable(milestone, flags);
    dest.writeParcelable(assignee, flags);
    dest.writeByte((byte) (open ? 1 : 0));
    dest.writeString(direction);
    dest.writeString(sortType);
  }
}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void writeToParcel(Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeByte(reusedDownloadedFile ? (byte) 1 : (byte) 0);
  dest.writeLong(this.totalBytes);
}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void writeToParcel(Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeByte(reusedDownloadedFile ? (byte) 1 : (byte) 0);
  dest.writeInt(this.totalBytes);
}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void writeToParcel(Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeByte(resuming ? (byte) 1 : (byte) 0);
  dest.writeLong(this.totalBytes);
  dest.writeString(this.etag);
  dest.writeString(this.fileName);
}

代码示例来源:origin: lingochamp/FileDownloader

@Override
public void writeToParcel(Parcel dest, int flags) {
  super.writeToParcel(dest, flags);
  dest.writeByte(resuming ? (byte) 1 : (byte) 0);
  dest.writeInt(this.totalBytes);
  dest.writeString(this.etag);
  dest.writeString(this.fileName);
}

代码示例来源:origin: JessYanCoding/AndroidAutoSize

@Override
public void writeToParcel(Parcel dest, int flags) {
  dest.writeByte(this.isBaseOnWidth ? (byte) 1 : (byte) 0);
  dest.writeFloat(this.sizeInDp);
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testReadWriteSingleByte() {
 byte val = 1;
 parcel.writeByte(val);
 parcel.setDataPosition(0);
 assertThat(parcel.readByte()).isEqualTo(val);
}

代码示例来源:origin: robolectric/robolectric

@Test
public void testReadWriteMultipleBytes() {
 for (byte i = Byte.MIN_VALUE; i < Byte.MAX_VALUE; ++i) {
  parcel.writeByte(i);
 }
 parcel.setDataPosition(0);
 for (byte i = Byte.MIN_VALUE; i < Byte.MAX_VALUE; ++i) {
  assertThat(parcel.readByte()).isEqualTo(i);
 }
 // now try to read past the number of items written and see what happens
 assertThat(parcel.readByte()).isEqualTo((byte) 0);
}

相关文章

Parcel类方法