本文整理了Java中android.os.Parcel.readLong()
方法的一些代码示例,展示了Parcel.readLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parcel.readLong()
方法的具体详情如下:
包路径:android.os.Parcel
类名称:Parcel
方法名:readLong
[英]Read a long integer value from the parcel at the current dataPosition().
[中]从当前dataPosition()处的地块读取长整数值。
代码示例来源:origin: lingochamp/FileDownloader
ProgressMessageSnapshot(Parcel in) {
super(in);
this.sofarBytes = in.readLong();
}
}
代码示例来源:origin: lingochamp/FileDownloader
protected LongParcel(Parcel in) {
this.v1 = in.readLong();
this.v2 = in.readLong();
this.v3 = in.readLong();
}
代码示例来源:origin: lingochamp/FileDownloader
PendingMessageSnapshot(Parcel in) {
super(in);
this.sofarBytes = in.readLong();
this.totalBytes = in.readLong();
}
}
代码示例来源:origin: bumptech/glide
private MediaStoreData(Parcel in) {
rowId = in.readLong();
uri = Uri.parse(in.readString());
mimeType = in.readString();
dateTaken = in.readLong();
dateModified = in.readLong();
orientation = in.readInt();
type = Type.valueOf(in.readString());
}
代码示例来源:origin: lingochamp/FileDownloader
CompletedSnapshot(Parcel in) {
super(in);
this.reusedDownloadedFile = in.readByte() != 0;
this.totalBytes = in.readLong();
}
代码示例来源:origin: zhihu/Matisse
private Item(Parcel source) {
id = source.readLong();
mimeType = source.readString();
uri = source.readParcelable(Uri.class.getClassLoader());
size = source.readLong();
duration = source.readLong();
}
代码示例来源:origin: google/ExoPlayer
@Override
public TimeSignalCommand createFromParcel(Parcel in) {
return new TimeSignalCommand(in.readLong(), in.readLong());
}
代码示例来源:origin: google/ExoPlayer
private PrivateCommand(Parcel in) {
ptsAdjustment = in.readLong();
identifier = in.readLong();
commandBytes = new byte[in.readInt()];
in.readByteArray(commandBytes);
}
代码示例来源:origin: lingochamp/FileDownloader
protected FileDownloadTaskAtom(Parcel in) {
this.url = in.readString();
this.path = in.readString();
this.totalBytes = in.readLong();
}
代码示例来源:origin: koral--/android-gif-drawable
private GifAnimationMetaData(Parcel in) {
mLoopCount = in.readInt();
mDuration = in.readInt();
mHeight = in.readInt();
mWidth = in.readInt();
mImageCount = in.readInt();
mMetadataBytesCount = in.readLong();
mPixelsBytesCount = in.readLong();
}
代码示例来源:origin: google/ExoPlayer
public static ComponentSplice createFromParcel(Parcel in) {
return new ComponentSplice(in.readInt(), in.readLong(), in.readLong());
}
代码示例来源:origin: google/ExoPlayer
/* package */ SchemeData(Parcel in) {
uuid = new UUID(in.readLong(), in.readLong());
licenseServerUrl = in.readString();
mimeType = in.readString();
data = in.createByteArray();
requiresSecureDecryption = in.readByte() != 0;
}
代码示例来源:origin: google/ExoPlayer
/* package */ ChapterFrame(Parcel in) {
super(ID);
this.chapterId = castNonNull(in.readString());
this.startTimeMs = in.readInt();
this.endTimeMs = in.readInt();
this.startOffset = in.readLong();
this.endOffset = in.readLong();
int subFrameCount = in.readInt();
subFrames = new Id3Frame[subFrameCount];
for (int i = 0; i < subFrameCount; i++) {
subFrames[i] = in.readParcelable(Id3Frame.class.getClassLoader());
}
}
代码示例来源:origin: google/ExoPlayer
/* package */ EventMessage(Parcel in) {
schemeIdUri = castNonNull(in.readString());
value = castNonNull(in.readString());
presentationTimeUs = in.readLong();
durationMs = in.readLong();
id = in.readLong();
messageData = castNonNull(in.createByteArray());
}
代码示例来源:origin: robolectric/robolectric
public boolean readFromParcel(Parcel parcel) {
bits.setValue(parcel.readLong());
int count = bits.count();
if (count > MAX_AXES) {
return false;
}
for (int i = 0; i < count; i++) {
values[i] = parcel.readFloat();
}
return true;
}
代码示例来源:origin: robolectric/robolectric
@Test
public void testReadWriteMultipleLongs() {
for (long i = 0; i < 10; ++i) {
parcel.writeLong(i);
}
parcel.setDataPosition(0);
for (long i = 0; i < 10; ++i) {
assertThat(parcel.readLong()).isEqualTo(i);
}
// now try to read past the number of items written and see what happens
assertThat(parcel.readLong()).isEqualTo(0L);
}
代码示例来源:origin: robolectric/robolectric
@Test(expected = RuntimeException.class)
public void testWriteStringReadLong() {
String val = "test";
parcel.writeString(val);
parcel.setDataPosition(0);
parcel.readLong();
}
代码示例来源:origin: robolectric/robolectric
@Test
public void testReadWriteSingleLong() {
long val = 5;
parcel.writeLong(val);
parcel.setDataPosition(0);
assertThat(parcel.readLong()).isEqualTo(val);
}
代码示例来源:origin: robolectric/robolectric
@Test
public void testByteArrayOfZeroesReadAsZeroes() {
parcel.writeByteArray(new byte[15]);
assertThat(parcel.dataSize()).isEqualTo(20);
parcel.setDataPosition(0);
assertThat(parcel.readInt()).isEqualTo(15);
assertThat(parcel.readLong()).isEqualTo(0);
assertThat(parcel.readLong()).isEqualTo(0);
assertThat(parcel.dataPosition()).isEqualTo(20);
}
代码示例来源:origin: robolectric/robolectric
@Test
public void testReadLongWhenEmpty() {
assertThat(parcel.readLong()).isEqualTo(0);
assertThat(parcel.dataPosition()).isEqualTo(0);
assertInvariants();
}
内容来源于网络,如有侵权,请联系作者删除!