use of org.apache.hadoop.hive.serde2.lazy.LazyInteger in project hive by apache.
the class LazyDioInteger method init.
/* (non-Javadoc)
* This provides a LazyInteger like class which can be initialized from data stored in a
* binary format.
*
* @see org.apache.hadoop.hive.serde2.lazy.LazyObject#init
* (org.apache.hadoop.hive.serde2.lazy.ByteArrayRef, int, int)
*/
@Override
public void init(ByteArrayRef bytes, int start, int length) {
int value = 0;
try {
in = new ByteStream.Input(bytes.getData(), start, length);
din = new DataInputStream(in);
value = din.readInt();
data.set(value);
isNull = false;
} catch (IOException e) {
isNull = true;
} finally {
try {
din.close();
} catch (IOException e) {
// swallow exception
}
try {
in.close();
} catch (IOException e) {
// swallow exception
}
}
}
Aggregations