OutputStream entityStream) throws IOException, WebApplicationException {
marshal(t, mediaType, entityStream);
}
static <T extends TBase> void marshal(T t, MediaType mediaType, OutputStream entityStream) throws IOException {
TIOStreamTransport transport = new TIOStreamTransport(entityStream);
TProtocol protocol = null;
if (THRIFT_TYPE.isCompatible(mediaType)) {
protocol = new TBinaryProtocol.Factory().getProtocol(transport);
} else if (MediaType.APPLICATION_JSON_TYPE.isCompatible(mediaType)) {
protocol = new TJSONProtocol.Factory().getProtocol(transport);