Code example for DataInput

Methods: readBoolean, readInt, skipBytes

0
	 * @throws IOException 
	 */ 
	public static int skip(DataInput file) throws IOException
	{ 
        /* read if the file has column indexes */ 
		boolean hasColumnIndexes = file.readBoolean();
        int totalBytesRead = 1;
 
        if(hasColumnIndexes)
        { 
    		/* read only the column index list */ 
    		int columnIndexSize = file.readInt();
    		totalBytesRead += 4;
 
            /* skip the column index data */ 
    		file.skipBytes(columnIndexSize);
    		totalBytesRead += columnIndexSize;
        } 
 
        return totalBytesRead;
	}