PlainReader.java 757 Bytes
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.fontengine.font.postscript;

import com.adobe.fontengine.font.FontInputStream;
import com.adobe.fontengine.font.InvalidFontException;
import com.adobe.fontengine.font.postscript.Reader;
import java.io.IOException;

final class PlainReader
implements Reader {
    int lastRead;

    PlainReader() {
    }

    public int read(FontInputStream stream) throws IOException, InvalidFontException {
        this.lastRead = stream.read();
        if (this.lastRead == -1) {
            throw new InvalidFontException("unexpected end of file");
        }
        return this.lastRead;
    }

    public void unreadLast(FontInputStream stream) throws IOException {
        stream.unread(this.lastRead);
    }
}