Fixed TODO
Fixed NPE if we will have a sequence of different ByteBufs (direct/heap) for encoding