I don't think you can do this. You will have to have your layer wrap application data in its own packaging layer. And of course, if there's a TCP break, you have no idea how many bytes were sent/received on either end.