Bug 8988 - Check for empty payload properly
Do not use InputStream#avalaible method to check for empty payload's
input streams in our implementations of MessageBodyReader interface.
InputStream#avalaible method returns an estimate of the number of bytes
that can be read from input stream without blocking. We cannot be sure
the stream is actually empty, even if this method returns 0.
Wrap the payload's input stream in PushbackInputStream and try to read
and unread from it instead.
Change-Id: I43b3a8d837f3dc4bc59d7cc2db29ffa06786844f
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>