2002-01-30 21:22:28 -05:00
|
|
|
/* ====================================================================
|
2006-12-22 14:18:16 -05:00
|
|
|
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
|
2004-04-09 09:05:39 -04:00
|
|
|
|
|
|
|
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.
|
|
|
|
==================================================================== */
|
2002-01-30 21:22:28 -05:00
|
|
|
|
|
|
|
package org.apache.poi.hssf.record;
|
|
|
|
|
2008-12-03 19:08:45 -05:00
|
|
|
import org.apache.poi.util.HexDump;
|
|
|
|
import org.apache.poi.util.LittleEndianOutput;
|
2002-01-30 21:22:28 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-09 20:40:58 -04:00
|
|
|
* Title: Continue Record(0x003C) - Helper class used primarily for SST Records <P>
|
2002-01-30 21:22:28 -05:00
|
|
|
* Description: handles overflow for prior record in the input
|
|
|
|
* stream; content is tailored to that prior record<P>
|
|
|
|
* @author Marc Johnson (mjohnson at apache dot org)
|
|
|
|
* @author Andrew C. Oliver (acoliver at apache dot org)
|
2003-03-07 10:49:04 -05:00
|
|
|
* @author Csaba Nagy (ncsaba at yahoo dot com)
|
2002-01-30 21:22:28 -05:00
|
|
|
*/
|
2015-09-28 19:16:58 -04:00
|
|
|
public final class ContinueRecord extends StandardRecord implements Cloneable {
|
2002-01-30 21:22:28 -05:00
|
|
|
public final static short sid = 0x003C;
|
2008-10-30 18:07:26 -04:00
|
|
|
private byte[] _data;
|
2002-01-30 21:22:28 -05:00
|
|
|
|
2008-10-09 20:40:58 -04:00
|
|
|
public ContinueRecord(byte[] data) {
|
|
|
|
_data = data;
|
2002-01-30 21:22:28 -05:00
|
|
|
}
|
|
|
|
|
2008-10-30 21:02:55 -04:00
|
|
|
protected int getDataSize() {
|
|
|
|
return _data.length;
|
2002-01-30 21:22:28 -05:00
|
|
|
}
|
|
|
|
|
2008-12-03 19:08:45 -05:00
|
|
|
public void serialize(LittleEndianOutput out) {
|
|
|
|
out.write(_data);
|
2002-01-30 21:22:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get the data for continuation
|
|
|
|
* @return byte array containing all of the continued data
|
|
|
|
*/
|
2008-12-03 19:08:45 -05:00
|
|
|
public byte[] getData() {
|
2008-10-09 20:40:58 -04:00
|
|
|
return _data;
|
2002-01-30 21:22:28 -05:00
|
|
|
}
|
|
|
|
|
2008-12-03 19:08:45 -05:00
|
|
|
public String toString() {
|
2002-01-30 21:22:28 -05:00
|
|
|
StringBuffer buffer = new StringBuffer();
|
|
|
|
|
|
|
|
buffer.append("[CONTINUE RECORD]\n");
|
2008-12-03 19:08:45 -05:00
|
|
|
buffer.append(" .data = ").append(HexDump.toHex(_data)).append("\n");
|
2002-01-30 21:22:28 -05:00
|
|
|
buffer.append("[/CONTINUE RECORD]\n");
|
|
|
|
return buffer.toString();
|
|
|
|
}
|
|
|
|
|
2008-12-03 19:08:45 -05:00
|
|
|
public short getSid() {
|
2006-01-03 02:24:01 -05:00
|
|
|
return sid;
|
2002-01-30 21:22:28 -05:00
|
|
|
}
|
|
|
|
|
2008-12-03 19:08:45 -05:00
|
|
|
public ContinueRecord(RecordInputStream in) {
|
|
|
|
_data = in.readRemainder();
|
2002-01-30 21:22:28 -05:00
|
|
|
}
|
2003-07-27 14:49:52 -04:00
|
|
|
|
2015-09-28 19:16:58 -04:00
|
|
|
@Override
|
|
|
|
public ContinueRecord clone() {
|
2008-12-03 19:08:45 -05:00
|
|
|
return new ContinueRecord(_data);
|
2008-10-09 20:40:58 -04:00
|
|
|
}
|
2002-01-30 21:22:28 -05:00
|
|
|
}
|