Loading apct-tests/perftests/core/src/com/android/internal/util/FastDataPerfTest.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class FastDataPerfTest { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { while (state.keepRunning()) { os.reset(); os.reset(); final FastDataOutput out = FastDataOutput.obtainUsing4ByteSequences(os); final FastDataOutput out = ArtFastDataOutput.obtain(os); try { try { doWrite(out); doWrite(out); out.flush(); out.flush(); Loading @@ -84,7 +84,7 @@ public class FastDataPerfTest { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { while (state.keepRunning()) { os.reset(); os.reset(); final FastDataOutput out = FastDataOutput.obtainUsing3ByteSequences(os); final FastDataOutput out = FastDataOutput.obtain(os); try { try { doWrite(out); doWrite(out); out.flush(); out.flush(); Loading Loading @@ -116,7 +116,7 @@ public class FastDataPerfTest { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { while (state.keepRunning()) { is.reset(); is.reset(); final FastDataInput in = FastDataInput.obtainUsing4ByteSequences(is); final FastDataInput in = ArtFastDataInput.obtain(is); try { try { doRead(in); doRead(in); } finally { } finally { Loading @@ -131,7 +131,7 @@ public class FastDataPerfTest { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { while (state.keepRunning()) { is.reset(); is.reset(); final FastDataInput in = FastDataInput.obtainUsing3ByteSequences(is); final FastDataInput in = FastDataInput.obtain(is); try { try { doRead(in); doRead(in); } finally { } finally { Loading core/java/android/net/netstats/NetworkStatsDataMigrationUtils.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -37,7 +37,7 @@ import android.os.Environment; import android.util.AtomicFile; import android.util.AtomicFile; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.FastDataInput; import com.android.internal.util.ArtFastDataInput; import libcore.io.IoUtils; import libcore.io.IoUtils; Loading Loading @@ -254,7 +254,7 @@ public class NetworkStatsDataMigrationUtils { private static void readPlatformCollection(@NonNull NetworkStatsCollection.Builder builder, private static void readPlatformCollection(@NonNull NetworkStatsCollection.Builder builder, @NonNull File file) throws IOException { @NonNull File file) throws IOException { final FileInputStream is = new FileInputStream(file); final FileInputStream is = new FileInputStream(file); final FastDataInput dataIn = new FastDataInput(is, BUFFER_SIZE); final ArtFastDataInput dataIn = new ArtFastDataInput(is, BUFFER_SIZE); try { try { readPlatformCollection(builder, dataIn); readPlatformCollection(builder, dataIn); } finally { } finally { Loading core/java/android/util/Xml.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -22,7 +22,8 @@ import android.os.SystemProperties; import android.system.ErrnoException; import android.system.ErrnoException; import android.system.Os; import android.system.Os; import com.android.internal.util.BinaryXmlPullParser; import com.android.internal.util.ArtBinaryXmlPullParser; import com.android.internal.util.ArtBinaryXmlSerializer; import com.android.internal.util.BinaryXmlSerializer; import com.android.internal.util.BinaryXmlSerializer; import com.android.internal.util.FastXmlSerializer; import com.android.internal.util.FastXmlSerializer; import com.android.internal.util.XmlUtils; import com.android.internal.util.XmlUtils; Loading Loading @@ -146,7 +147,7 @@ public class Xml { * @hide * @hide */ */ public static @NonNull TypedXmlPullParser newBinaryPullParser() { public static @NonNull TypedXmlPullParser newBinaryPullParser() { return new BinaryXmlPullParser(); return new ArtBinaryXmlPullParser(); } } /** /** Loading Loading @@ -225,7 +226,7 @@ public class Xml { * @hide * @hide */ */ public static @NonNull TypedXmlSerializer newBinarySerializer() { public static @NonNull TypedXmlSerializer newBinarySerializer() { return new BinaryXmlSerializer(); return new ArtBinaryXmlSerializer(); } } /** /** Loading core/java/com/android/internal/util/ArtBinaryXmlPullParser.java 0 → 100644 +36 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.util; import android.annotation.NonNull; import java.io.DataInput; import java.io.InputStream; /** * {@inheritDoc} * <p> * This decodes large code-points using 4-byte sequences, and <em>is not</em> compatible with the * {@link DataInput} API contract, which specifies that large code-points must be encoded with * 3-byte sequences. */ public class ArtBinaryXmlPullParser extends BinaryXmlPullParser { @NonNull protected FastDataInput obtainFastDataInput(@NonNull InputStream is) { return ArtFastDataInput.obtain(is); } } core/java/com/android/internal/util/ArtBinaryXmlSerializer.java 0 → 100644 +37 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.util; import android.annotation.NonNull; import java.io.DataOutput; import java.io.OutputStream; /** * {@inheritDoc} * <p> * This encodes large code-points using 4-byte sequences and <em>is not</em> compatible with the * {@link DataOutput} API contract, which specifies that large code-points must be encoded with * 3-byte sequences. */ public class ArtBinaryXmlSerializer extends BinaryXmlSerializer { @NonNull @Override protected FastDataOutput obtainFastDataOutput(@NonNull OutputStream os) { return ArtFastDataOutput.obtain(os); } } Loading
apct-tests/perftests/core/src/com/android/internal/util/FastDataPerfTest.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class FastDataPerfTest { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { while (state.keepRunning()) { os.reset(); os.reset(); final FastDataOutput out = FastDataOutput.obtainUsing4ByteSequences(os); final FastDataOutput out = ArtFastDataOutput.obtain(os); try { try { doWrite(out); doWrite(out); out.flush(); out.flush(); Loading @@ -84,7 +84,7 @@ public class FastDataPerfTest { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { while (state.keepRunning()) { os.reset(); os.reset(); final FastDataOutput out = FastDataOutput.obtainUsing3ByteSequences(os); final FastDataOutput out = FastDataOutput.obtain(os); try { try { doWrite(out); doWrite(out); out.flush(); out.flush(); Loading Loading @@ -116,7 +116,7 @@ public class FastDataPerfTest { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { while (state.keepRunning()) { is.reset(); is.reset(); final FastDataInput in = FastDataInput.obtainUsing4ByteSequences(is); final FastDataInput in = ArtFastDataInput.obtain(is); try { try { doRead(in); doRead(in); } finally { } finally { Loading @@ -131,7 +131,7 @@ public class FastDataPerfTest { final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); while (state.keepRunning()) { while (state.keepRunning()) { is.reset(); is.reset(); final FastDataInput in = FastDataInput.obtainUsing3ByteSequences(is); final FastDataInput in = FastDataInput.obtain(is); try { try { doRead(in); doRead(in); } finally { } finally { Loading
core/java/android/net/netstats/NetworkStatsDataMigrationUtils.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -37,7 +37,7 @@ import android.os.Environment; import android.util.AtomicFile; import android.util.AtomicFile; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.FastDataInput; import com.android.internal.util.ArtFastDataInput; import libcore.io.IoUtils; import libcore.io.IoUtils; Loading Loading @@ -254,7 +254,7 @@ public class NetworkStatsDataMigrationUtils { private static void readPlatformCollection(@NonNull NetworkStatsCollection.Builder builder, private static void readPlatformCollection(@NonNull NetworkStatsCollection.Builder builder, @NonNull File file) throws IOException { @NonNull File file) throws IOException { final FileInputStream is = new FileInputStream(file); final FileInputStream is = new FileInputStream(file); final FastDataInput dataIn = new FastDataInput(is, BUFFER_SIZE); final ArtFastDataInput dataIn = new ArtFastDataInput(is, BUFFER_SIZE); try { try { readPlatformCollection(builder, dataIn); readPlatformCollection(builder, dataIn); } finally { } finally { Loading
core/java/android/util/Xml.java +4 −3 Original line number Original line Diff line number Diff line Loading @@ -22,7 +22,8 @@ import android.os.SystemProperties; import android.system.ErrnoException; import android.system.ErrnoException; import android.system.Os; import android.system.Os; import com.android.internal.util.BinaryXmlPullParser; import com.android.internal.util.ArtBinaryXmlPullParser; import com.android.internal.util.ArtBinaryXmlSerializer; import com.android.internal.util.BinaryXmlSerializer; import com.android.internal.util.BinaryXmlSerializer; import com.android.internal.util.FastXmlSerializer; import com.android.internal.util.FastXmlSerializer; import com.android.internal.util.XmlUtils; import com.android.internal.util.XmlUtils; Loading Loading @@ -146,7 +147,7 @@ public class Xml { * @hide * @hide */ */ public static @NonNull TypedXmlPullParser newBinaryPullParser() { public static @NonNull TypedXmlPullParser newBinaryPullParser() { return new BinaryXmlPullParser(); return new ArtBinaryXmlPullParser(); } } /** /** Loading Loading @@ -225,7 +226,7 @@ public class Xml { * @hide * @hide */ */ public static @NonNull TypedXmlSerializer newBinarySerializer() { public static @NonNull TypedXmlSerializer newBinarySerializer() { return new BinaryXmlSerializer(); return new ArtBinaryXmlSerializer(); } } /** /** Loading
core/java/com/android/internal/util/ArtBinaryXmlPullParser.java 0 → 100644 +36 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.util; import android.annotation.NonNull; import java.io.DataInput; import java.io.InputStream; /** * {@inheritDoc} * <p> * This decodes large code-points using 4-byte sequences, and <em>is not</em> compatible with the * {@link DataInput} API contract, which specifies that large code-points must be encoded with * 3-byte sequences. */ public class ArtBinaryXmlPullParser extends BinaryXmlPullParser { @NonNull protected FastDataInput obtainFastDataInput(@NonNull InputStream is) { return ArtFastDataInput.obtain(is); } }
core/java/com/android/internal/util/ArtBinaryXmlSerializer.java 0 → 100644 +37 −0 Original line number Original line Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.util; import android.annotation.NonNull; import java.io.DataOutput; import java.io.OutputStream; /** * {@inheritDoc} * <p> * This encodes large code-points using 4-byte sequences and <em>is not</em> compatible with the * {@link DataOutput} API contract, which specifies that large code-points must be encoded with * 3-byte sequences. */ public class ArtBinaryXmlSerializer extends BinaryXmlSerializer { @NonNull @Override protected FastDataOutput obtainFastDataOutput(@NonNull OutputStream os) { return ArtFastDataOutput.obtain(os); } }