}
public static byte[] readEntirelyAsByte(AtmosphereResource r) {
AtmosphereRequest request = r.getRequest();
AtmosphereRequest.Body body = request.body();
if (request.body().isEmpty()) {
BufferedInputStream bufferedStream = null;
ByteArrayOutputStream bbIS = new ByteArrayOutputStream();
try {
try {
InputStream inputStream = request.getInputStream();