2004-04-09 07:45:38 -04: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.
|
|
|
|
==================================================================== */
|
2004-04-09 07:45:38 -04:00
|
|
|
|
|
|
|
package org.apache.poi.hssf.record;
|
|
|
|
|
2008-10-05 03:22:12 -04:00
|
|
|
import org.apache.poi.util.HexDump;
|
2008-10-23 15:08:42 -04:00
|
|
|
import org.apache.poi.util.LittleEndianInput;
|
|
|
|
import org.apache.poi.util.LittleEndianOutput;
|
2004-04-09 07:45:38 -04:00
|
|
|
|
|
|
|
/**
|
2016-06-13 19:08:13 -04:00
|
|
|
* ftGmo (0x0006)<p>
|
2004-04-09 07:45:38 -04:00
|
|
|
* The group marker record is used as a position holder for groups.
|
|
|
|
*/
|
2015-09-28 19:16:58 -04:00
|
|
|
public final class GroupMarkerSubRecord extends SubRecord implements Cloneable {
|
2008-10-23 15:08:42 -04:00
|
|
|
public final static short sid = 0x0006;
|
2004-04-09 07:45:38 -04:00
|
|
|
|
2008-10-23 15:08:42 -04:00
|
|
|
private static final byte[] EMPTY_BYTE_ARRAY = { };
|
2004-04-09 07:45:38 -04:00
|
|
|
|
2016-06-13 19:08:13 -04:00
|
|
|
// would really love to know what goes in here.
|
|
|
|
private byte[] reserved;
|
2004-04-09 07:45:38 -04:00
|
|
|
|
2008-10-23 15:08:42 -04:00
|
|
|
public GroupMarkerSubRecord() {
|
|
|
|
reserved = EMPTY_BYTE_ARRAY;
|
2004-04-09 07:45:38 -04:00
|
|
|
}
|
|
|
|
|
2008-10-23 15:08:42 -04:00
|
|
|
public GroupMarkerSubRecord(LittleEndianInput in, int size) {
|
|
|
|
byte[] buf = new byte[size];
|
|
|
|
in.readFully(buf);
|
|
|
|
reserved = buf;
|
2004-04-09 07:45:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public String toString()
|
|
|
|
{
|
|
|
|
StringBuffer buffer = new StringBuffer();
|
|
|
|
|
|
|
|
String nl = System.getProperty("line.separator");
|
|
|
|
buffer.append("[ftGmo]" + nl);
|
|
|
|
buffer.append(" reserved = ").append(HexDump.toHex(reserved)).append(nl);
|
|
|
|
buffer.append("[/ftGmo]" + nl);
|
|
|
|
return buffer.toString();
|
|
|
|
}
|
|
|
|
|
2008-10-23 15:08:42 -04:00
|
|
|
public void serialize(LittleEndianOutput out) {
|
|
|
|
out.writeShort(sid);
|
|
|
|
out.writeShort(reserved.length);
|
|
|
|
out.write(reserved);
|
2004-04-09 07:45:38 -04:00
|
|
|
}
|
|
|
|
|
2008-10-23 15:08:42 -04:00
|
|
|
protected int getDataSize() {
|
|
|
|
return reserved.length;
|
2004-04-09 07:45:38 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public short getSid()
|
|
|
|
{
|
|
|
|
return sid;
|
|
|
|
}
|
|
|
|
|
2015-09-28 19:16:58 -04:00
|
|
|
@Override
|
|
|
|
public GroupMarkerSubRecord clone() {
|
2004-04-09 07:45:38 -04:00
|
|
|
GroupMarkerSubRecord rec = new GroupMarkerSubRecord();
|
|
|
|
rec.reserved = new byte[reserved.length];
|
|
|
|
for ( int i = 0; i < reserved.length; i++ )
|
|
|
|
rec.reserved[i] = reserved[i];
|
|
|
|
return rec;
|
|
|
|
}
|
2008-10-05 03:22:12 -04:00
|
|
|
}
|