Create a new [`GenericByteArray`] where `value` is repeated `repeat_count` times. # Panics This will panic if value's length multiplied by `repeat_count` overflows usize.
(value: impl AsRef<T::Native>, repeat_count: usize)
| 196 | /// This will panic if value's length multiplied by `repeat_count` overflows usize. |
| 197 | /// |
| 198 | pub fn new_repeated(value: impl AsRef<T::Native>, repeat_count: usize) -> Self { |
| 199 | let s: &[u8] = value.as_ref().as_ref(); |
| 200 | let value_offsets = OffsetBuffer::from_repeated_length(s.len(), repeat_count); |
| 201 | let bytes: Buffer = { |
| 202 | let mut mutable_buffer = MutableBuffer::with_capacity(0); |
| 203 | mutable_buffer.repeat_slice_n_times(s, repeat_count); |
| 204 | |
| 205 | mutable_buffer.into() |
| 206 | }; |
| 207 | |
| 208 | Self { |
| 209 | data_type: T::DATA_TYPE, |
| 210 | value_data: bytes, |
| 211 | value_offsets, |
| 212 | nulls: None, |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | /// Creates a [`GenericByteArray`] based on an iterator of values without nulls |
| 217 | pub fn from_iter_values<Ptr, I>(iter: I) -> Self |
nothing calls this directly
no test coverage detected