char buffer implementation