diff --git a/parquet/src/util/cursor.rs b/parquet/src/util/cursor.rs index eaed6c7010e6..c847fc8f6823 100644 --- a/parquet/src/util/cursor.rs +++ b/parquet/src/util/cursor.rs @@ -154,6 +154,18 @@ impl InMemoryWriteableCursor { let inner = self.buffer.lock().unwrap(); inner.get_ref().to_vec() } + + /// Returns a length of the underlying buffer + pub fn len(&self) -> usize { + let inner = self.buffer.lock().unwrap(); + inner.get_ref().len() + } + + /// Returns true if the underlying buffer contains no elements + pub fn is_empty(&self) -> bool { + let inner = self.buffer.lock().unwrap(); + inner.get_ref().is_empty() + } } impl TryClone for InMemoryWriteableCursor {