blob: 677e20ef1c468c6147a6221346b358f6d1ab8c73 [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;
}
}