Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.RecordFormatException


    if (svm == null) {
      throw new IllegalArgumentException("sfm must not be null");
    }
    if (formulaRec.hasCachedResultString()) {
      if (stringRec == null) {
        throw new RecordFormatException("Formula record flag is set but String record was not found");
      }
      _stringRecord = stringRec;
    } else {
      // Usually stringRec is null here (in agreement with what the formula rec says).
      // In the case where an extra StringRecord is erroneously present, Excel (2007)
View Full Code Here


   */
  private static void handleMissingSharedFormulaRecord(FormulaRecord formula) {
    // make sure 'unshared' formula is actually available
    Ptg firstToken = formula.getParsedExpression()[0];
    if (firstToken instanceof ExpPtg) {
      throw new RecordFormatException(
          "SharedFormulaRecord not found for FormulaRecord with (isSharedFormula=true)");
    }
    // could log an info message here since this is a fairly unusual occurrence.
    formula.setSharedFormula(false); // no point leaving the flag erroneously set
  }
View Full Code Here

      return field_2_first_col;
    }

    public String toFormulaString()
    {
        throw new RecordFormatException("Coding Error: Expected ExpPtg to be converted from Shared to Non-Shared Formula by ValueRecordsAggregate, but it wasn't");
    }
View Full Code Here

          token_3_arrayValues[x][y] = new Double(in.readDouble());
            } else if (grbit == 0x02) {
              //Ignore the doco, it is actually a unicode string with all the
              //trimmings ie 16 bit size, option byte etc
              token_3_arrayValues[x][y] = in.readUnicodeString();
            } else throw new RecordFormatException("Unknown grbit '"+grbit+"'");
          }
        }

    }
View Full Code Here

      return field_2_first_col;
    }   

    public String toFormulaString(Workbook book)
    {
        throw new RecordFormatException("Coding Error: Expected ExpPtg to be converted from Shared to Non-Shared Formula");
    }
View Full Code Here

            maxDgId = Math.max(maxDgId, field_5_fileIdClusters[i].getDrawingGroupId());
            size += 8;
        }
        bytesRemaining         -= size;
        if (bytesRemaining != 0)
            throw new RecordFormatException("Expecting no remaining data but got " + bytesRemaining + " byte(s).");
        return 8 + size + bytesRemaining;
    }
View Full Code Here

            for ( int i = 0; i < data.length; i++ )
                deflaterOutputStream.write( data[i] );
        }
        catch ( IOException e )
        {
            throw new RecordFormatException( e.toString() );
        }

        return out.toByteArray();
    }
View Full Code Here

            while ( ( c = inflaterInputStream.read() ) != -1 )
                out.write( c );
        }
        catch ( IOException e )
        {
            throw new RecordFormatException( e.toString() );
        }
        return out.toByteArray();
    }
View Full Code Here

        field_1_rectX1 =  LittleEndian.getInt( data, pos + size );size+=4;
        field_2_rectY1 =  LittleEndian.getInt( data, pos + size );size+=4;
        field_3_rectX2 =  LittleEndian.getInt( data, pos + size );size+=4;
        field_4_rectY2 =  LittleEndian.getInt( data, pos + size );size+=4;
        bytesRemaining -= size;
        if (bytesRemaining != 0) throw new RecordFormatException("Expected no remaining bytes but got " + bytesRemaining);
//        remainingData  =  new byte[bytesRemaining];
//        System.arraycopy( data, pos + size, remainingData, 0, bytesRemaining );
        return 8 + size + bytesRemaining;
    }
View Full Code Here

        int pos = offset+8+thedata.length;

        listener.afterRecordSerialize( pos, getRecordId(), pos - offset, this );
        int size = pos - offset;
        if (size != getRecordSize())
            throw new RecordFormatException(size + " bytes written but getRecordSize() reports " + getRecordSize());
        return size;
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.RecordFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.