private void convertIBMGenerator() {
		DataInputStream myInput = null;
		try {
			// Objects to read the input file in binary format
			FileInputStream fin = new FileInputStream(new File(input));
			myInput = new DataInputStream(fin);
			
			// Variable to remember if we have written -1 after a group of items or not
			// (because in the binary format, at the end of a line there is no -1 before the -2
			//  but in spmf format there is one).
			boolean lastMinus1 = false; 
			
			int count = 0; // to count the number of line
			
			// we read the file integer by integer until the end of the file
			while (myInput.available() != 0) {
				// we read the first 32 bits and convert to big indian
				int value = INT_little_endian_TO_big_endian(myInput.readInt());
				// if it is "-1", the end of an itemset
				if (value == -1) { 
					// we write the same thing as output
					writer.write("-1 "); 
					lastMinus1 = true; // to remember that we have written -1
				} 
				// if it is "-2", the end of a sequence
				else if (value == -2) { 
					// check if the last "-1" was not written
					if (lastMinus1 == false) {
						writer.write("-1 "); // write "-1"
					}
					writer.write("-2 "); // write end of line
					
					count++;// increase the number of sequences
					
					// if we have read enough sequences, we stop.
					if(count == lineCount){
						break;
					}
					writer.newLine(); // create new line
				}
				// else it is an item
				else {
					// we write the item
					writer.write(value + " ");  
					
					lastMinus1 = false; // to remember that we need to write a -1
				}
			}
			myInput.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}