Implementing Buffer interface.