OutputByteStreamImpl.java 1.41 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.internal.io.stream;

import com.adobe.internal.io.stream.InputByteStream;
import com.adobe.internal.io.stream.OutputByteStream;
import com.adobe.internal.io.stream.OutputStreamImpl;
import com.adobe.internal.io.stream.SkippingOutputStream;
import java.io.IOException;

abstract class OutputByteStreamImpl
implements OutputByteStream {
    private long position;

    OutputByteStreamImpl() {
    }

    @Override
    public abstract void write(int var1) throws IOException;

    @Override
    public abstract void write(byte[] var1, int var2, int var3) throws IOException;

    @Override
    public void write(byte[] bytes) throws IOException {
        this.write(bytes, 0, bytes.length);
    }

    @Override
    public OutputByteStream seek(long position) throws IOException {
        if (position < 0) {
            position = 0;
        }
        this.position = position;
        return this;
    }

    @Override
    public long getPosition() throws IOException {
        return this.position;
    }

    @Override
    public boolean eof() throws IOException {
        return this.getPosition() >= this.length();
    }

    @Override
    public SkippingOutputStream toOutputStream() throws IOException {
        return new OutputStreamImpl(this);
    }

    @Override
    public InputByteStream closeAndConvert() throws IOException {
        this.close();
        return null;
    }
}