mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
45 lines
1.1 KiB
Java
45 lines
1.1 KiB
Java
package androidx.fragment.app;
|
|
|
|
import android.util.Log;
|
|
import java.io.Writer;
|
|
|
|
/* loaded from: classes2.dex */
|
|
final class LogWriter extends Writer {
|
|
private StringBuilder mBuilder = new StringBuilder(128);
|
|
private final String mTag;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public LogWriter(String str) {
|
|
this.mTag = str;
|
|
}
|
|
|
|
@Override // java.io.Writer, java.io.Closeable, java.lang.AutoCloseable
|
|
public void close() {
|
|
flushBuilder();
|
|
}
|
|
|
|
@Override // java.io.Writer, java.io.Flushable
|
|
public void flush() {
|
|
flushBuilder();
|
|
}
|
|
|
|
@Override // java.io.Writer
|
|
public void write(char[] cArr, int i, int i2) {
|
|
for (int i3 = 0; i3 < i2; i3++) {
|
|
char c = cArr[i + i3];
|
|
if (c == '\n') {
|
|
flushBuilder();
|
|
} else {
|
|
this.mBuilder.append(c);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void flushBuilder() {
|
|
if (this.mBuilder.length() > 0) {
|
|
Log.d(this.mTag, this.mBuilder.toString());
|
|
StringBuilder sb = this.mBuilder;
|
|
sb.delete(0, sb.length());
|
|
}
|
|
}
|
|
}
|