blob: 3d2b1415f34fa8bd6bb04ed90d815e6818f4beb1 [file] [log] [blame]
package edu.uci.ics.hivesterix.runtime.inspector;
import edu.uci.ics.hyracks.algebricks.data.IBinaryBooleanInspector;
public class HiveBinaryBooleanInspector implements IBinaryBooleanInspector {
HiveBinaryBooleanInspector() {
}
@Override
public boolean getBooleanValue(byte[] bytes, int offset, int length) {
if (length == 0)
return false;
if (length != 1)
throw new IllegalStateException("boolean field error: with length "
+ length);
return bytes[0] == 1;
}
}