Skip to content

Instantly share code, notes, and snippets.

@markauskas
Created April 26, 2011 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markauskas/941865 to your computer and use it in GitHub Desktop.
Save markauskas/941865 to your computer and use it in GitHub Desktop.
// resource is a com.sun.jersey.api.client.WebResource
ClientResponse response = resource.get(ClientResponse.class);
response.bufferEntity();
response.getEntityInputStream().mark(Integer.MAX_VALUE);
TypeA x = response.getEntity(TypeA.class);
getEntityInputStream().reset();
TypeB y = response.getEntity(TypeB.class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment