HBASE-18754 (addendum) close the input resource
This commit is contained in:
parent
f887a5a3af
commit
f6ba8185ea
|
@ -199,10 +199,11 @@ public abstract class TimeRangeTracker {
|
||||||
ProtobufUtil.mergeFrom(builder, data, pblen, data.length - pblen);
|
ProtobufUtil.mergeFrom(builder, data, pblen, data.length - pblen);
|
||||||
return TimeRangeTracker.create(type, builder.getFrom(), builder.getTo());
|
return TimeRangeTracker.create(type, builder.getFrom(), builder.getTo());
|
||||||
} else {
|
} else {
|
||||||
DataInputStream in = new DataInputStream(new ByteArrayInputStream(data));
|
try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(data))) {
|
||||||
return TimeRangeTracker.create(type, in.readLong(), in.readLong());
|
return TimeRangeTracker.create(type, in.readLong(), in.readLong());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static byte[] toByteArray(TimeRangeTracker tracker) {
|
public static byte[] toByteArray(TimeRangeTracker tracker) {
|
||||||
return ProtobufUtil.prependPBMagic(
|
return ProtobufUtil.prependPBMagic(
|
||||||
|
|
Loading…
Reference in New Issue