diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java index 08d9853802a..203bea3d514 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/TimeRangeTracker.java @@ -199,8 +199,9 @@ public abstract class TimeRangeTracker { ProtobufUtil.mergeFrom(builder, data, pblen, data.length - pblen); return TimeRangeTracker.create(type, builder.getFrom(), builder.getTo()); } else { - DataInputStream in = new DataInputStream(new ByteArrayInputStream(data)); - return TimeRangeTracker.create(type, in.readLong(), in.readLong()); + try (DataInputStream in = new DataInputStream(new ByteArrayInputStream(data))) { + return TimeRangeTracker.create(type, in.readLong(), in.readLong()); + } } }