NullOutputByteStream.java 1.03 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.OutputByteStreamImpl;
import com.adobe.internal.io.stream.SkippingOutputStream;
import java.io.IOException;

public class NullOutputByteStream
extends OutputByteStreamImpl {
    private long length = 0;

    @Override
    public void write(int b) throws IOException {
        this.seek(this.getPosition() + 1);
        this.length = Math.max(this.getPosition(), this.length);
    }

    @Override
    public void write(byte[] bytes, int offset, int length) throws IOException {
        this.seek(this.getPosition() + (long)length);
        this.length = Math.max(this.getPosition(), this.length);
    }

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

    @Override
    public void close() throws IOException {
    }

    @Override
    public void flush() throws IOException {
    }
}