import org.apache.poi.util.LittleEndianByteArrayInputStream;
@Internal
-class Array
+public class Array
{
static class ArrayDimension {
private long _size;
private final ArrayHeader _header = new ArrayHeader();
private TypedPropertyValue[] _values;
- Array() {}
-
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
_header.read(lei);
long numberOfScalarsLong = _header.getNumberOfScalarValues();
}
}
}
-
- TypedPropertyValue[] getValues(){
+
+ public TypedPropertyValue[] getValues(){
return _values;
}
}
import org.apache.poi.util.LittleEndianInput;
@Internal
-class Blob {
+public class Blob {
//arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 1_000_000;
private byte[] _value;
- Blob() {}
-
- void read( LittleEndianInput lei ) {
+ public void read( LittleEndianInput lei ) {
int size = lei.readInt();
_value = IOUtils.safelyAllocate(size, MAX_RECORD_LENGTH);
if ( size > 0 ) {
import org.apache.poi.util.POILogger;
@Internal
-class ClipboardData {
+public class ClipboardData {
//arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 100_000_000;
private int _format;
private byte[] _value;
-
- ClipboardData() {}
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
int offset = lei.getReadIndex();
int size = lei.readInt();
lei.readFully(_value);
}
- byte[] getValue() {
+ public byte[] getValue() {
return _value;
}
- byte[] toByteArray() {
+ public byte[] toByteArray() {
byte[] result = new byte[LittleEndianConsts.INT_SIZE*2+_value.length];
LittleEndianByteArrayOutputStream bos = new LittleEndianByteArrayOutputStream(result,0);
try {
IOUtils.closeQuietly(bos);
}
}
-
- void setValue( byte[] value ) {
+
+ public void setValue( byte[] value ) {
_value = value.clone();
}
}
import org.apache.poi.util.POILogger;
@Internal
-class CodePageString {
+public class CodePageString {
//arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 100_000;
private final static POILogger LOG = POILogFactory.getLogger( CodePageString.class );
private byte[] _value;
-
-
- CodePageString() {}
- void read( LittleEndianByteArrayInputStream lei ) {
+
+ public void read( LittleEndianByteArrayInputStream lei ) {
int offset = lei.getReadIndex();
int size = lei.readInt();
_value = IOUtils.safelyAllocate(size, MAX_RECORD_LENGTH);
TypedPropertyValue.skipPadding(lei);
}
- String getJavaValue( int codepage ) throws UnsupportedEncodingException {
+ public String getJavaValue( int codepage ) throws UnsupportedEncodingException {
int cp = ( codepage == -1 ) ? Property.DEFAULT_CODEPAGE : codepage;
String result = CodePageUtil.getStringFromCodePage(_value, cp);
return result.substring( 0, terminator );
}
- int getSize() {
+ public int getSize() {
return LittleEndianConsts.INT_SIZE + _value.length;
}
- void setJavaValue( String string, int codepage ) throws UnsupportedEncodingException {
+ public void setJavaValue( String string, int codepage ) throws UnsupportedEncodingException {
int cp = ( codepage == -1 ) ? Property.DEFAULT_CODEPAGE : codepage;
_value = CodePageUtil.getBytesInCodePage(string + "\0", cp);
}
- int write( OutputStream out ) throws IOException {
+ public int write( OutputStream out ) throws IOException {
LittleEndian.putUInt( _value.length, out );
out.write( _value );
return LittleEndianConsts.INT_SIZE + _value.length;
import org.apache.poi.util.LittleEndianByteArrayInputStream;
@Internal
-class Currency {
+public class Currency {
private static final int SIZE = 8;
private final byte[] _value = new byte[SIZE];
-
- Currency() {}
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
lei.readFully(_value);
}
}
import org.apache.poi.util.LittleEndianByteArrayInputStream;
@Internal
-class Date {
+public class Date {
private static final int SIZE = 8;
private final byte[] _value = new byte[SIZE];
-
- Date() {}
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
lei.readFully(_value);
}
}
import org.apache.poi.util.LittleEndianByteArrayInputStream;
@Internal
-class Decimal {
+public class Decimal {
/**
* Findbugs: UNR_UNREAD_FIELD
*/
private int field_4_hi32;
private long field_5_lo64;
- Decimal() {}
-
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
field_1_wReserved = lei.readShort();
field_2_scale = lei.readByte();
field_3_sign = lei.readByte();
import java.io.OutputStream;
import java.util.Date;
+import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianByteArrayInputStream;
import org.apache.poi.util.LittleEndianConsts;
+@Internal
public class Filetime {
/**
* The difference between the Windows epoch (1601-01-01
private int _dwHighDateTime;
private int _dwLowDateTime;
- Filetime() {}
-
- Filetime( int low, int high ) {
+ public Filetime() {}
+
+ public Filetime( int low, int high ) {
_dwLowDateTime = low;
_dwHighDateTime = high;
}
- Filetime( Date date ) {
+ public Filetime( Date date ) {
long filetime = Filetime.dateToFileTime(date);
_dwHighDateTime = (int) ((filetime >>> 32) & UINT_MASK);
_dwLowDateTime = (int) (filetime & UINT_MASK);
}
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
_dwLowDateTime = lei.readInt();
_dwHighDateTime = lei.readInt();
}
- long getHigh() {
+ public long getHigh() {
return _dwHighDateTime;
}
- long getLow() {
+ public long getLow() {
return _dwLowDateTime;
}
- byte[] toByteArray() {
+ public byte[] toByteArray() {
byte[] result = new byte[SIZE];
LittleEndian.putInt( result, 0 * LittleEndianConsts.INT_SIZE, _dwLowDateTime );
LittleEndian.putInt( result, 1 * LittleEndianConsts.INT_SIZE, _dwHighDateTime );
return result;
}
- int write( OutputStream out ) throws IOException {
+ public int write( OutputStream out ) throws IOException {
LittleEndian.putInt( _dwLowDateTime, out );
LittleEndian.putInt( _dwHighDateTime, out );
return SIZE;
}
- Date getJavaValue() {
+ public Date getJavaValue() {
long l = (((long)_dwHighDateTime) << 32) | (_dwLowDateTime & UINT_MASK);
return filetimeToDate( l );
}
import org.apache.poi.util.LittleEndianByteArrayInputStream;
@Internal
-class GUID {
+public class GUID {
private int _data1;
private short _data2;
private short _data3;
private long _data4;
- GUID() {}
-
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
_data1 = lei.readInt();
_data2 = lei.readShort();
_data3 = lei.readShort();
import org.apache.poi.util.Internal;
@Internal
-class IndirectPropertyName extends CodePageString {
+public class IndirectPropertyName extends CodePageString {
IndirectPropertyName() {}
}
import org.apache.poi.util.POILogger;
@Internal
-class TypedPropertyValue {
+public class TypedPropertyValue {
private static final POILogger LOG = POILogFactory.getLogger( TypedPropertyValue.class );
private int _type;
private Object _value;
- TypedPropertyValue( int type, Object value ) {
+ public TypedPropertyValue( int type, Object value ) {
_type = type;
_value = value;
}
- Object getValue() {
+ public Object getValue() {
return _value;
}
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
_type = lei.readShort();
short padding = lei.readShort();
if ( padding != 0 ) {
readValue( lei );
}
- void readValue( LittleEndianByteArrayInputStream lei ) {
+ public void readValue( LittleEndianByteArrayInputStream lei ) {
switch ( _type ) {
case Variant.VT_EMPTY:
case Variant.VT_NULL:
import org.apache.poi.util.StringUtil;
@Internal
-class UnicodeString {
+public class UnicodeString {
private static final POILogger LOG = POILogFactory.getLogger( UnicodeString.class );
//arbitrarily selected; may need to increase
private static final int MAX_RECORD_LENGTH = 100_000;
private byte[] _value;
-
- UnicodeString() {}
- void read(LittleEndianByteArrayInputStream lei) {
+ public void read(LittleEndianByteArrayInputStream lei) {
final int length = lei.readInt();
final int unicodeBytes = length*2;
_value = IOUtils.safelyAllocate(unicodeBytes, MAX_RECORD_LENGTH);
TypedPropertyValue.skipPadding(lei);
}
- byte[] getValue() {
+ public byte[] getValue() {
return _value;
}
- String toJavaString() {
+ public String toJavaString() {
if ( _value.length == 0 ) {
return null;
}
return result.substring( 0, terminator );
}
- void setJavaValue( String string ) throws UnsupportedEncodingException {
+ public void setJavaValue( String string ) throws UnsupportedEncodingException {
_value = CodePageUtil.getBytesInCodePage(string + "\0", CodePageUtil.CP_UNICODE);
}
- int write( OutputStream out ) throws IOException {
+ public int write( OutputStream out ) throws IOException {
LittleEndian.putUInt( _value.length / 2, out );
out.write( _value );
return LittleEndianConsts.INT_SIZE + _value.length;
import org.apache.poi.util.POILogger;
@Internal
-class VariantBool {
+public class VariantBool {
private final static POILogger LOG = POILogFactory.getLogger( VariantBool.class );
static final int SIZE = 2;
private boolean _value;
- VariantBool() {}
-
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
short value = lei.readShort();
switch (value) {
case 0:
}
}
- boolean getValue() {
+ public boolean getValue() {
return _value;
}
- void setValue( boolean value ) {
+ public void setValue( boolean value ) {
this._value = value;
}
}
* Holder for vector-type properties
*/
@Internal
-class Vector {
+public class Vector {
private final short _type;
private TypedPropertyValue[] _values;
- Vector( short type ) {
+ public Vector( short type ) {
this._type = type;
}
- void read( LittleEndianByteArrayInputStream lei ) {
+ public void read( LittleEndianByteArrayInputStream lei ) {
final long longLength = lei.readUInt();
if ( longLength > Integer.MAX_VALUE ) {
_values = values.toArray(new TypedPropertyValue[values.size()]);
}
- TypedPropertyValue[] getValues(){
+ public TypedPropertyValue[] getValues(){
return _values;
}
}
import org.apache.poi.util.LittleEndianByteArrayInputStream;
@Internal
-class VersionedStream
+public class VersionedStream
{
private final GUID _versionGuid = new GUID();
private final IndirectPropertyName _streamName = new IndirectPropertyName();
-
- VersionedStream() {}
- void read( LittleEndianByteArrayInputStream lei ) {
+ public VersionedStream() {}
+
+ public void read( LittleEndianByteArrayInputStream lei ) {
_versionGuid.read(lei);
_streamName.read(lei);
}