package io.flutter.plugins.pathprovider;

import ed.z;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;

/* JADX INFO: loaded from: classes.dex */
public final class c extends z {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final c f28272d = new c();

    @Override // ed.z
    public final Object readValueOfType(byte b10, ByteBuffer byteBuffer) {
        if (b10 != -127) {
            return super.readValueOfType(b10, byteBuffer);
        }
        Object value = readValue(byteBuffer);
        if (value == null) {
            return null;
        }
        return Messages$StorageDirectory.values()[((Long) value).intValue()];
    }

    @Override // ed.z
    public final void writeValue(ByteArrayOutputStream byteArrayOutputStream, Object obj) {
        if (!(obj instanceof Messages$StorageDirectory)) {
            super.writeValue(byteArrayOutputStream, obj);
        } else {
            byteArrayOutputStream.write(129);
            writeValue(byteArrayOutputStream, obj == null ? null : Integer.valueOf(((Messages$StorageDirectory) obj).index));
        }
    }
}
