All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jpedal.io.types.KeyArray Maven / Gradle / Ivy

/*
 * ===========================================
 * Java Pdf Extraction Decoding Access Library
 * ===========================================
 *
 * Project Info:  http://www.idrsolutions.com
 * Help section for developers at http://www.idrsolutions.com/support/
 *
 * (C) Copyright 1997-2017 IDRsolutions and Contributors.
 *
 * This file is part of JPedal/JPDF2HTML5
 *
 @LICENSE@
 *
 * ---------------
 * KeyArray.java
 * ---------------
 */
package org.jpedal.io.types;

import org.jpedal.io.PdfFileReader;
import org.jpedal.objects.raw.PdfDictionary;
import org.jpedal.objects.raw.PdfObject;

/**
 * parse PDF array data from PDF
 */
public class KeyArray extends Array {

    public KeyArray(final PdfFileReader pdfFileReader, final int i, final byte[] raw) {
        super(pdfFileReader, i, PdfDictionary.VALUE_IS_KEY_ARRAY, raw);
    }

    @Override
    boolean isSingleKey() {
        return StreamReaderUtils.isRef(arrayData, j2);
    }

    @Override
    void fillArray(final int elementCount, final PdfObject pdfObject) {

        final byte[][] finalByteValues = new byte[elementCount][];

        for (int a = 0; a < elementCount; a++) {
            finalByteValues[a] = valuesRead.get(a);
        }

        pdfObject.setKeyArray(PDFkeyInt, finalByteValues);

    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy