No, you cannot know what is in Java, and the ability to see the last acked tcp message would not help, since what you write to the socket can be sent in one or more messages / packets.
You need to implement the application protocol in which the receiver sends ack.
source share