private void initDataLayout(File file) throws IOException {

        if (file.exists()) {    // Load the data formats from the file
            byte[] buffer = new byte[32];
            mappedByteBuffer.get(buffer);
            ByteBuffer bbuffer = ByteBuffer.wrap(buffer);

            int index;

            if ((index = indexOf(FLOAT_COOKIE_BIG_ENDIAN, buffer)) != -1) {
                order = ByteOrder.BIG_ENDIAN;
            }
            else if ((index = indexOf(FLOAT_COOKIE_LITTLE_ENDIAN, buffer))
                    != -1) {
                order = ByteOrder.LITTLE_ENDIAN;
            }
            else {
                throw new IOException("Invalid RRD file");
            }
            mappedByteBuffer.order(order);
            bbuffer.order(order);

            switch (index) {

            case 12:
                alignment = 4;
                break;

            case 16:
                alignment = 8;
                break;

            default:
                throw new RuntimeException("Unsupported architecture");
            }

            bbuffer.position(index + 8);
            //We cannot have dsCount && rracount == 0
            //If one is 0, it's a 64 bits rrd
            int int1 = bbuffer.getInt();  //Should be dsCount in ILP32
            int int2 = bbuffer.getInt();  //Should be rraCount in ILP32
            if(int1  == 0 || int2 ==0) {
                longSize = 8;
            }
        }
        else {                // Default to data formats for this hardware architecture
        }
        // Reset file pointer to start of file
        mappedByteBuffer.rewind();
    }