org.jpedal.io.types.IntArray 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@
*
* ---------------
* IntArray.java
* ---------------
*/
package org.jpedal.io.types;
import org.jpedal.io.PdfFileReader;
import org.jpedal.objects.raw.PdfDictionary;
import org.jpedal.objects.raw.PdfObject;
import org.jpedal.utils.NumberUtils;
/**
* @author markee
*/
public class IntArray extends Array {
public IntArray(final PdfFileReader pdfFileReader, final int i, final byte[] raw) {
super(pdfFileReader, i, PdfDictionary.VALUE_IS_INT_ARRAY, raw);
}
@Override
void fillArray(final int elementCount, final PdfObject pdfObject) {
final int[] finalByteValues = new int[elementCount];
byte[] data;
for (int a = 0; a < elementCount; a++) {
data = valuesRead.get(a);
finalByteValues[a] = NumberUtils.parseInt(0, data.length, data);
}
pdfObject.setIntArray(PDFkeyInt, finalByteValues);
}
}