En-tête non valide lire fichier xls

Je suis à la lecture d'un fichier excel sur mon système local. Je suis à l'aide de POI jar Version 3.7, mais d'avoir d'erreur Invalide la signature de l'en-tête;
lire -2300849302551019537 ou en Hexadécimal 0xE011BDBFEFBDBFEF ,
attendu -2226271756974174256 ou en Hexadécimal 0xE11AB1A1E011CFD0.

De l'ouverture du fichier xls avec Excel fonctionne très bien.

La codeblock là que ça se passe:
Quelqu'un à une idée ?

/**
 * create a new HeaderBlockReader from an InputStream
 *
 * @param stream the source InputStream
 *
 * @exception IOException on errors or bad data
 */
public HeaderBlockReader(InputStream stream) throws IOException {
    //At this point, we don't know how big our
    // block sizes are
    //So, read the first 32 bytes to check, then
    // read the rest of the block
    byte[] blockStart = new byte[32];
    int bsCount = IOUtils.readFully(stream, blockStart);
    if(bsCount != 32) {
        throw alertShortRead(bsCount, 32);
    }

    //verify signature
    long signature = LittleEndian.getLong(blockStart, _signature_offset);

    if (signature != _signature) {
        //Is it one of the usual suspects?
        byte[] OOXML_FILE_HEADER = POIFSConstants.OOXML_FILE_HEADER;
        if(blockStart[0] == OOXML_FILE_HEADER[0] &&
            blockStart[1] == OOXML_FILE_HEADER[1] &&
            blockStart[2] == OOXML_FILE_HEADER[2] &&
            blockStart[3] == OOXML_FILE_HEADER[3]) {
            throw new OfficeXmlFileException("The supplied data appears to be in the Office 2007+ XML. You are calling the part of POI that deals with OLE2 Office Documents. You need to call a different part of POI to process this data (eg XSSF instead of HSSF)");
        }
        if ((signature & 0xFF8FFFFFFFFFFFFFL) == 0x0010000200040009L) {
            //BIFF2 raw stream starts with BOF (sid=0x0009, size=0x0004, data=0x00t0)
            throw new IllegalArgumentException("The supplied data appears to be in BIFF2 format.  "
                    + "POI only supports BIFF8 format");
        }

        //Give a generic error
        throw new IOException("Invalid header signature; read "
                              + longToHex(signature) + ", expected "
                              + longToHex(_signature));
    }
Vous jetez cette exception à partir de votre code? throw new IOException? confondu par votre question, vous lui jeter de l'exception et de vous demander pourquoi?
L'Exception est levée par l'Apache Poi Bibliothèque et au-dessus, c'est le code qui s'y jette.
apache poi est de ne pas jeter de l'erreur, votre code ne jeter "nouvelle IOException("en-tête non Valide signature; lire"
Le HeaderBlockReader(InputStream stream) constructeur est partie de l'Apache POI bibliothèque. Mon code devient l'existant fichier xls comme un flux et puis je veux créer un nouveau POIFileSystem avec cette InputStream.

OriginalL'auteur dutchman79 | 2012-12-19