Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
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:
⏎ org/apache/poi/ddf/EscherComplexProperty.java
/* ====================================================================
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.ddf;
import java.util.Arrays;
import java.util.Map;
import java.util.function.Supplier;
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.LittleEndian;
/**
* A complex property differs from a simple property in that the data can not fit inside a 32 bit
* integer. See the specification for more detailed information regarding exactly what is
* stored here.
*/
public class EscherComplexProperty extends EscherProperty {
//arbitrarily selected; may need to increase
private static final int DEFAULT_MAX_RECORD_LENGTH = 100_000_000;
private static int MAX_RECORD_LENGTH = DEFAULT_MAX_RECORD_LENGTH;
private byte[] complexData;
/**
* @param length the max record length allowed for EscherComplexProperty
*/
public static void setMaxRecordLength(int length) {
MAX_RECORD_LENGTH = length;
}
/**
* @return the max record length allowed for EscherComplexProperty
*/
public static int getMaxRecordLength() {
return MAX_RECORD_LENGTH;
}
/**
* Create a complex property using the property id and a byte array containing the complex
* data value size.
*
* @param id The id consists of the property number, a flag indicating whether this is a blip id and a flag
* indicating that this is a complex property.
* @param complexSize The byte size of this property.
*/
public EscherComplexProperty(short id, int complexSize) {
super((short)(id | IS_COMPLEX));
complexData = IOUtils.safelyAllocate(complexSize, MAX_RECORD_LENGTH);
}
/**
* Create a complex property using the property number, a flag to indicate whether this is a
* blip reference and the complex property data size.
*
* @param propertyNumber The property number
* @param isBlipId Whether this is a blip id. Should be false.
* @param complexSize The byte size of this property.
*/
public EscherComplexProperty(short propertyNumber, boolean isBlipId, int complexSize) {
this((short)(propertyNumber | (isBlipId ? IS_BLIP : 0)), complexSize);
}
/**
* Create a complex property using the property type, a flag to indicate whether this is a
* blip reference and the complex property data size.
*
* @param type The property type
* @param isBlipId Whether this is a blip id. Should be false.
* @param complexSize The byte size of this property.
*/
public EscherComplexProperty(EscherPropertyTypes type, boolean isBlipId, int complexSize) {
this((short)(type.propNumber | (isBlipId ? IS_BLIP : 0)), complexSize);
}
/**
* Serializes the simple part of this property. i.e. the first 6 bytes.
*/
@Override
public int serializeSimplePart(byte[] data, int pos) {
LittleEndian.putShort(data, pos, getId());
LittleEndian.putInt(data, pos + 2, complexData.length);
return 6;
}
/**
* Serializes the complex part of this property
*
* @param data The data array to serialize to
* @param pos The offset within data to start serializing to.
* @return The number of bytes serialized.
*/
@Override
public int serializeComplexPart(byte[] data, int pos) {
System.arraycopy(complexData, 0, data, pos, complexData.length);
return complexData.length;
}
/**
* Get the complex data value.
*
* @return the complex bytes
*/
public byte[] getComplexData() {
return complexData;
}
public int setComplexData(byte[] complexData) {
return setComplexData(complexData, 0);
}
public int setComplexData(byte[] complexData, int offset) {
if (complexData == null) {
return 0;
} else {
int copySize = Math.max(0, Math.min(this.complexData.length, complexData.length - offset));
System.arraycopy(complexData, offset, this.complexData, 0, copySize);
return copySize;
}
}
protected void resizeComplexData(int newSize) {
resizeComplexData(newSize, Integer.MAX_VALUE);
}
protected void resizeComplexData(int newSize, int copyLen) {
if (newSize == complexData.length) {
return;
}
byte[] newArray = IOUtils.safelyAllocate(newSize, MAX_RECORD_LENGTH);
System.arraycopy(complexData, 0, newArray, 0, Math.min(Math.min(complexData.length, copyLen),newSize));
complexData = newArray;
}
/**
* Determine whether this property is equal to another property.
*
* @param o The object to compare to.
* @return True if the objects are equal.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof EscherComplexProperty)) {
return false;
}
EscherComplexProperty escherComplexProperty = (EscherComplexProperty) o;
return Arrays.equals(complexData, escherComplexProperty.complexData);
}
/**
* Calculates the number of bytes required to serialize this property.
*
* @return Number of bytes
*/
@Override
public int getPropertySize() {
return 6 + complexData.length;
}
@Override
public int hashCode() {
return Arrays.deepHashCode(new Object[]{complexData, getId()});
}
@Override
public Map<String, Supplier<?>> getGenericProperties() {
return GenericRecordUtil.getGenericProperties(
"base", super::getGenericProperties,
"data", this::getComplexData
);
}
}
⏎ org/apache/poi/ddf/EscherComplexProperty.java
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 Download
⇒ What Is poi-ooxml-5.2.3.jar?
⇐ What Is poi-bin-5.2.3-20220909.zip?
2017-04-04, ≈296🔥, 0💬
Popular Posts:
JDK 11 jdk.crypto.cryptoki.jmod is the JMOD file for JDK 11 Crypto Cryptoki module. JDK 11 Crypto KI...
Where to get the Java source code for Connector/J 8.0 User Impl module? Java source code files for C...
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was develo...
How to display XML element type information with the jaxp\TypeInfoWriter.java provided in the Apache...
Where to find answers to frequently asked questions on Downloading and Using JDK (Java Development K...