package com.ifpdos.udi.sdk.binderhttpd;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import okio.Buffer;
import okio.BufferedSink;
import okio.ByteString;
import okio.Source;
import okio.Timeout;

/* JADX INFO: loaded from: classes.dex */
public class Sink implements BufferedSink {
    private byte[] mData = new byte[0];

    private byte[] addData(byte[] bArr, int i2, int i3) {
        byte[] bArr2 = this.mData;
        if (bArr2 == null) {
            return (byte[]) bArr.clone();
        }
        if (bArr == null) {
            return bArr2;
        }
        byte[] bArr3 = new byte[bArr2.length + i3];
        System.arraycopy(bArr2, 0, bArr3, 0, bArr2.length);
        System.arraycopy(bArr, i2, bArr3, this.mData.length, i3);
        return bArr3;
    }

    @Override // okio.BufferedSink
    public Buffer buffer() {
        return null;
    }

    @Override // okio.Sink, java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.Channel
    public void close() {
    }

    public BufferedSink emit() throws IOException {
        throw new IOException("not support emit");
    }

    public BufferedSink emitCompleteSegments() throws IOException {
        throw new IOException("not support emitCompleteSegments");
    }

    @Override // okio.BufferedSink, okio.Sink, java.io.Flushable
    public void flush() {
    }

    @Override // okio.BufferedSink
    public abstract /* synthetic */ Buffer getBuffer();

    public byte[] getData() {
        return this.mData;
    }

    @Override // java.nio.channels.Channel
    public boolean isOpen() {
        return true;
    }

    public OutputStream outputStream() {
        return null;
    }

    @Override // okio.Sink
    public Timeout timeout() {
        return null;
    }

    @Override // java.nio.channels.WritableByteChannel
    public int write(ByteBuffer byteBuffer) {
        byte[] bArrArray = byteBuffer.array();
        write(bArrArray);
        return bArrArray.length;
    }

    @Override // okio.BufferedSink
    public BufferedSink write(ByteString byteString) {
        return write(byteString.o());
    }

    public abstract /* synthetic */ BufferedSink write(ByteString byteString, int i2, int i3);

    public BufferedSink write(Source source, long j2) throws IOException {
        throw new IOException("not support write Source");
    }

    @Override // okio.BufferedSink
    public BufferedSink write(byte[] bArr) {
        this.mData = addData(bArr, 0, bArr.length);
        return this;
    }

    @Override // okio.BufferedSink
    public BufferedSink write(byte[] bArr, int i2, int i3) {
        this.mData = addData(bArr, i2, i3);
        return this;
    }

    @Override // okio.Sink
    public void write(Buffer buffer, long j2) throws IOException {
        throw new IOException("not support write source byteCount");
    }

    @Override // okio.BufferedSink
    public long writeAll(Source source) throws IOException {
        throw new IOException("not support writeAll");
    }

    @Override // okio.BufferedSink
    public BufferedSink writeByte(int i2) throws IOException {
        throw new IOException("not support writeByte");
    }

    @Override // okio.BufferedSink
    public BufferedSink writeDecimalLong(long j2) throws IOException {
        throw new IOException("not support writeDecimalLong");
    }

    @Override // okio.BufferedSink
    public BufferedSink writeHexadecimalUnsignedLong(long j2) throws IOException {
        throw new IOException("not support writeHexadecimalUnsignedLong");
    }

    @Override // okio.BufferedSink
    public BufferedSink writeInt(int i2) throws IOException {
        throw new IOException("not support writeInt");
    }

    public BufferedSink writeIntLe(int i2) throws IOException {
        throw new IOException("not support writeIntLe");
    }

    public BufferedSink writeLong(long j2) throws IOException {
        throw new IOException("not support writeLong");
    }

    public BufferedSink writeLongLe(long j2) throws IOException {
        throw new IOException("not support writeLongLe");
    }

    @Override // okio.BufferedSink
    public BufferedSink writeShort(int i2) throws IOException {
        throw new IOException("not support writeShort");
    }

    public BufferedSink writeShortLe(int i2) throws IOException {
        throw new IOException("not support writeShortLe");
    }

    public BufferedSink writeString(String str, int i2, int i3, Charset charset) {
        return write(str.substring(i2, i3).getBytes());
    }

    public BufferedSink writeString(String str, Charset charset) {
        return write(str.getBytes());
    }

    @Override // okio.BufferedSink
    public BufferedSink writeUtf8(String str) {
        return write(str.getBytes());
    }

    public BufferedSink writeUtf8(String str, int i2, int i3) {
        return write(str.substring(i2, i3).getBytes());
    }

    public BufferedSink writeUtf8CodePoint(int i2) throws IOException {
        throw new IOException("not support writeUtf8CodePoint");
    }
}
