What Is poi-5.2.3.jar?

What Is poi-5.2.3.jar?

✍: FYIcenter.com

poi-5.2.3.jar is one of the JAR files for Apache POI 5.2.3, which provides an API for Microsoft document files of Word, Excel, PowerPoint, and Visio.

poi-5.2.3.jar supports Apache POI components that read and write Microsoft's OLE 2 Compound document format, which is used in early versions of Microsoft Office tools like Word 97, Excel 97, PowerPoint 97, etc.

poi-5.2.3.jar is distributed as part of the poi-bin-5.2.3-20220909.zip download file.

JAR File Size and Download Location:

JAR name: poi-5.2.3.jar
Target JDK version: 9

File name: poi.jar, poi-5.2.3.jar
File size: 2964641 bytes
Release date: 09-09-2022
Download: Apache POI Website

Here are Java Source Code files for poi-5.2.3.jar:


/* ====================================================================
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at


   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   See the License for the specific language governing permissions and
   limitations under the License.
==================================================================== */

package org.apache.poi.ss.formula.constant;

import org.apache.poi.util.LittleEndianInput;
import org.apache.poi.util.LittleEndianOutput;
import org.apache.poi.util.StringUtil;

 * To support Constant Values (2.5.7) as required by the CRN record.
 * This class is also used for two dimensional arrays which are encoded by
 * EXTERNALNAME (5.39) records and Array tokens.
public final class ConstantValueParser {
    // note - these (non-combinable) enum values are sparse.
    private static final int TYPE_EMPTY = 0;
    private static final int TYPE_NUMBER = 1;
    private static final int TYPE_STRING = 2;
    private static final int TYPE_BOOLEAN = 4;
    private static final int TYPE_ERROR_CODE = 16; // TODO - update OOO document to include this value

    private static final int TRUE_ENCODING = 1;
    private static final int FALSE_ENCODING = 0;

    // TODO - is this the best way to represent 'EMPTY'?
    private static final Object EMPTY_REPRESENTATION = null;

    private ConstantValueParser() {
        // no instances of this class

    public static Object[] parse(LittleEndianInput in, int nValues) {
        if (nValues < 0) {
            throw new IllegalArgumentException("Invalid number of values to parse: " + nValues);

        Object[] result = new Object[nValues];
        for (int i = 0; i < result.length; i++) {
            result[i] = readAConstantValue(in);
        return result;

    private static Object readAConstantValue(LittleEndianInput in) {
        byte grbit = in.readByte();
        switch(grbit) {
            case TYPE_EMPTY:
                in.readLong(); // 8 byte 'not used' field
                return EMPTY_REPRESENTATION;
            case TYPE_NUMBER:
                return in.readDouble();
            case TYPE_STRING:
                return StringUtil.readUnicodeString(in);
            case TYPE_BOOLEAN:
                return readBoolean(in);
            case TYPE_ERROR_CODE:
                int errCode = in.readUShort();
                // next 6 bytes are unused
                return ErrorConstant.valueOf(errCode);
        throw new IllegalArgumentException("Unknown grbit value (" + grbit + ")");

    private static Object readBoolean(LittleEndianInput in) {
        byte val = (byte)in.readLong(); // 7 bytes 'not used'
        switch(val) {
            case FALSE_ENCODING:
                return Boolean.FALSE;
            case TRUE_ENCODING:
                return Boolean.TRUE;
        // Don't tolerate unusual boolean encoded values (unless it becomes evident that they occur)
        throw new IllegalArgumentException("unexpected boolean encoding (" + val + ")");

    public static int getEncodedSize(Object[] values) {
        // start with one byte 'type' code for each value
        int result = values.length;
        for (Object value : values) {
            result += getEncodedSize(value);
        return result;

     * @return encoded size without the 'type' code byte
    private static int getEncodedSize(Object object) {
        if(object == EMPTY_REPRESENTATION) {
            return 8;
        Class<?> cls = object.getClass();

        if(cls == Boolean.class || cls == Double.class || cls == ErrorConstant.class) {
            return 8;
        String strVal = (String)object;
        return StringUtil.getEncodedSize(strVal);

    public static void encode(LittleEndianOutput out, Object[] values) {
        for (Object value : values) {
            encodeSingleValue(out, value);

    private static void encodeSingleValue(LittleEndianOutput out, Object value) {
        if (value == EMPTY_REPRESENTATION) {
        if (value instanceof Boolean) {
            Boolean bVal = ((Boolean)value);
            long longVal = bVal ? 1L : 0L;
        if (value instanceof Double) {
            Double dVal = (Double) value;
        if (value instanceof String) {
            String val = (String) value;
            StringUtil.writeUnicodeString(out, val);
        if (value instanceof ErrorConstant) {
            ErrorConstant ecVal = (ErrorConstant) value;
            long longVal = ecVal.getErrorCode();

        throw new IllegalStateException("Unexpected value type (" + value.getClass().getName() + "'");


Or download all of them as a single archive file:

File name: poi-5.2.3-src.zip
File size: 2479830 bytes
Release date: 2022-09-09


What Is poi-ooxml-5.2.3.jar?

What Is poi-bin-5.2.3-20220909.zip?

Downloading and Installing Apache POI Java Library

⇑⇑ FAQ for Apache POI (Poor Obfuscation Implementation)

2017-04-04, 58968👍, 0💬