An implementation of line-based framing