Example usage for org.apache.hadoop.io WritableComparator readFloat

List of usage examples for org.apache.hadoop.io WritableComparator readFloat

Introduction

In this page you can find the example usage for org.apache.hadoop.io WritableComparator readFloat.

Prototype

public static float readFloat(byte[] bytes, int start) 

Source Link

Document

Parse a float from a byte array.

Usage

From source file:org.apache.mrql.MR_float.java

License:Apache License

final public static int compare(byte[] x, int xs, int xl, byte[] y, int ys, int yl, int[] size) {
    size[0] = (Float.SIZE >> 3) + 1;
    float v = WritableComparator.readFloat(x, xs) - WritableComparator.readFloat(y, ys);
    return (v == 0) ? 0 : ((v > 0) ? 1 : -1);
}