summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-01-08 11:33:57 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-01-08 11:33:57 +0000
commitfe39a927b58ea563f567f94bd252fd490024df5f (patch)
treee13a413e67a4da39e7bf8d7a01c4e08901db0903 /core/java
parent68ba39f6d787a330d820b88c88424d9dfcc8d63e (diff)
parent5c5eff8d5c5ef91377221203f2fd6dadc2a2fe3d (diff)
Merge "Pivot network statistics to use DataInput/Output." am: 5b322f10be am: 5c5eff8d5c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540224 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ic0502659732c1957b297095a5332e6dc0b514397
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/net/NetworkStatsHistory.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/java/android/net/NetworkStatsHistory.java b/core/java/android/net/NetworkStatsHistory.java
index bf25602041cf..f41306301d42 100644
--- a/core/java/android/net/NetworkStatsHistory.java
+++ b/core/java/android/net/NetworkStatsHistory.java
@@ -45,8 +45,8 @@ import com.android.internal.util.IndentingPrintWriter;
import libcore.util.EmptyArray;
import java.io.CharArrayWriter;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.ProtocolException;
@@ -162,7 +162,7 @@ public class NetworkStatsHistory implements Parcelable {
out.writeLong(totalBytes);
}
- public NetworkStatsHistory(DataInputStream in) throws IOException {
+ public NetworkStatsHistory(DataInput in) throws IOException {
final int version = in.readInt();
switch (version) {
case VERSION_INIT: {
@@ -204,7 +204,7 @@ public class NetworkStatsHistory implements Parcelable {
}
}
- public void writeToStream(DataOutputStream out) throws IOException {
+ public void writeToStream(DataOutput out) throws IOException {
out.writeInt(VERSION_ADD_ACTIVE);
out.writeLong(bucketDuration);
writeVarLongArray(out, bucketStart, bucketCount);
@@ -768,7 +768,7 @@ public class NetworkStatsHistory implements Parcelable {
*/
public static class DataStreamUtils {
@Deprecated
- public static long[] readFullLongArray(DataInputStream in) throws IOException {
+ public static long[] readFullLongArray(DataInput in) throws IOException {
final int size = in.readInt();
if (size < 0) throw new ProtocolException("negative array size");
final long[] values = new long[size];
@@ -781,7 +781,7 @@ public class NetworkStatsHistory implements Parcelable {
/**
* Read variable-length {@link Long} using protobuf-style approach.
*/
- public static long readVarLong(DataInputStream in) throws IOException {
+ public static long readVarLong(DataInput in) throws IOException {
int shift = 0;
long result = 0;
while (shift < 64) {
@@ -797,7 +797,7 @@ public class NetworkStatsHistory implements Parcelable {
/**
* Write variable-length {@link Long} using protobuf-style approach.
*/
- public static void writeVarLong(DataOutputStream out, long value) throws IOException {
+ public static void writeVarLong(DataOutput out, long value) throws IOException {
while (true) {
if ((value & ~0x7FL) == 0) {
out.writeByte((int) value);
@@ -809,7 +809,7 @@ public class NetworkStatsHistory implements Parcelable {
}
}
- public static long[] readVarLongArray(DataInputStream in) throws IOException {
+ public static long[] readVarLongArray(DataInput in) throws IOException {
final int size = in.readInt();
if (size == -1) return null;
if (size < 0) throw new ProtocolException("negative array size");
@@ -820,7 +820,7 @@ public class NetworkStatsHistory implements Parcelable {
return values;
}
- public static void writeVarLongArray(DataOutputStream out, long[] values, int size)
+ public static void writeVarLongArray(DataOutput out, long[] values, int size)
throws IOException {
if (values == null) {
out.writeInt(-1);