Add implementation for reading samples from stream