1 /* ==================================================================== 2 Copyright 2003-2004 Apache Software Foundation 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 ==================================================================== */ 16 17 package org.apache.poi.hssf.record; 18 19 public interface CustomField 20 extends Cloneable 21 { 22 /** 23 * @return The size of this field in bytes. This operation is not valid 24 * until after the call to <code>fillField()</code> 25 */ 26 int getSize(); 27 28 /** 29 * Populates this fields data from the byte array passed in. 30 * @param data raw data 31 * @param size size of data 32 * @param offset of the record's data (provided a big array of the file) 33 * @return the number of bytes read. 34 */ 35 int fillField(byte [] data, short size, int offset); 36 37 /** 38 * Appends the string representation of this field to the supplied 39 * StringBuffer. 40 * 41 * @param str The string buffer to append to. 42 */ 43 void toString(StringBuffer str); 44 45 /** 46 * Converts this field to it's byte array form. 47 * @param offset The offset into the byte array to start writing to. 48 * @param data The data array to write to. 49 * @return The number of bytes written. 50 */ 51 int serializeField(int offset, byte[] data); 52 53 54 } 55