//Pass the realInputStream to the request object.
request.setDataInputStream(dataInput);
//The request object parses the realInputStream.
request.parse();
//The request object process business.
request.doBusiness();
//Get the response created by the request object.
for (GameResponse response : request.getResponses()) {
//Construct the response from an object to an outputStream.
outputStream.write(response.constructResponseInBytes());
}