Use more native node Buffer api for implementing BytesInput.