- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
96 lines
3.6 KiB
Java
96 lines
3.6 KiB
Java
package kotlin.io;
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.InputStreamReader;
|
|
import java.nio.charset.Charset;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.text.Charsets;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public abstract class FilesKt__FileReadWriteKt extends FilesKt__FilePathComponentsKt {
|
|
public static final void writeBytes(File file, byte[] array) {
|
|
Intrinsics.checkNotNullParameter(file, "<this>");
|
|
Intrinsics.checkNotNullParameter(array, "array");
|
|
FileOutputStream fileOutputStream = new FileOutputStream(file);
|
|
try {
|
|
fileOutputStream.write(array);
|
|
Unit unit = Unit.INSTANCE;
|
|
CloseableKt.closeFinally(fileOutputStream, null);
|
|
} finally {
|
|
}
|
|
}
|
|
|
|
public static final String readText(File file, Charset charset) {
|
|
Intrinsics.checkNotNullParameter(file, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(file), charset);
|
|
try {
|
|
String readText = TextStreamsKt.readText(inputStreamReader);
|
|
CloseableKt.closeFinally(inputStreamReader, null);
|
|
return readText;
|
|
} finally {
|
|
}
|
|
}
|
|
|
|
public static /* synthetic */ String readText$default(File file, Charset charset, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
charset = Charsets.UTF_8;
|
|
}
|
|
return readText(file, charset);
|
|
}
|
|
|
|
public static void writeText(File file, String text, Charset charset) {
|
|
Intrinsics.checkNotNullParameter(file, "<this>");
|
|
Intrinsics.checkNotNullParameter(text, "text");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
byte[] bytes = text.getBytes(charset);
|
|
Intrinsics.checkNotNullExpressionValue(bytes, "getBytes(...)");
|
|
writeBytes(file, bytes);
|
|
}
|
|
|
|
public static final void forEachLine(File file, Charset charset, Function1 action) {
|
|
Intrinsics.checkNotNullParameter(file, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
Intrinsics.checkNotNullParameter(action, "action");
|
|
TextStreamsKt.forEachLine(new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)), action);
|
|
}
|
|
|
|
public static /* synthetic */ List readLines$default(File file, Charset charset, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
charset = Charsets.UTF_8;
|
|
}
|
|
return readLines(file, charset);
|
|
}
|
|
|
|
public static final List readLines(File file, Charset charset) {
|
|
Intrinsics.checkNotNullParameter(file, "<this>");
|
|
Intrinsics.checkNotNullParameter(charset, "charset");
|
|
final ArrayList arrayList = new ArrayList();
|
|
forEachLine(file, charset, new Function1() { // from class: kotlin.io.FilesKt__FileReadWriteKt$readLines$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
|
|
invoke((String) obj);
|
|
return Unit.INSTANCE;
|
|
}
|
|
|
|
public final void invoke(String it) {
|
|
Intrinsics.checkNotNullParameter(it, "it");
|
|
arrayList.add(it);
|
|
}
|
|
});
|
|
return arrayList;
|
|
}
|
|
}
|