org.jboss.resteasy.spi.HttpResponse.getOutputStream()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中org.jboss.resteasy.spi.HttpResponse.getOutputStream()方法的一些代码示例,展示了HttpResponse.getOutputStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpResponse.getOutputStream()方法的具体详情如下:
包路径:org.jboss.resteasy.spi.HttpResponse
类名称:HttpResponse
方法名:getOutputStream

HttpResponse.getOutputStream介绍

暂无

代码示例

代码示例来源:origin: resteasy/Resteasy

@Override
public OutputStream getEntityStream()
{
 try
 {
   return httpResponse.getOutputStream();
 }
 catch (IOException e)
 {
   throw new RuntimeException(e);
 }
}

代码示例来源:origin: resteasy/Resteasy

default void close() throws IOException {
 // RESTEASY-1650
 getOutputStream().close();
}

代码示例来源:origin: resteasy/Resteasy

public void doWrite(Object toOutput, Class type, Type genericType,
          MediaType mediaType, Annotation[] annotations,
          MultivaluedMap<String, Object> requestHeaders,
          OutputStream outputStream) throws IOException
{
 final Map<String, Object> attributes = new HashMap<String, Object>();
 AbstractWriterInterceptorContext messageBodyWriterContext = new ClientWriterInterceptorContext(interceptors, factory, toOutput, type,
     genericType, annotations, mediaType, requestHeaders, outputStream, attributes);
 messageBodyWriterContext
     .proceed();
}

代码示例来源:origin: resteasy/Resteasy

ResteasyProviderFactory.getInstance(), t -> {
 }, true);
response.getOutputStream().write(SseConstants.EOL);
response.getOutputStream().write(SseConstants.EOL);
response.flushBuffer();
responseFlushed = true;

代码示例来源:origin: resteasy/Resteasy

response.getOutputStream().write(bout.toByteArray());
response.flushBuffer();

代码示例来源:origin: org.jboss.resteasy/resteasy-core

@Override
public OutputStream getEntityStream()
{
 try
 {
   return httpResponse.getOutputStream();
 }
 catch (IOException e)
 {
   throw new RuntimeException(e);
 }
}

代码示例来源:origin: org.jboss.resteasy/resteasy-jaxrs-20

@Override
public OutputStream getEntityStream()
{
 try
 {
   return httpResponse.getOutputStream();
 }
 catch (IOException e)
 {
   throw new RuntimeException(e);
 }
}

代码示例来源:origin: org.jboss.resteasy/resteasy-core-spi

default void close() throws IOException {
 // RESTEASY-1650
 getOutputStream().close();
}

代码示例来源:origin: resteasy/Resteasy

if (entity == null || response.getOutputStream() == null)
OutputStream os = sendHeaders ? new CommitHeaderOutputStream(response.getOutputStream(), callback) : response.getOutputStream();

代码示例来源:origin: stackoverflow.com

@RequestMapping...
public void getFile(HttpResponse resp) throws IOException {
 InputStream is = ... // get InputStream from your file
 resp.setContentType("text/html"); // or whatever is appropriate for your file
 OutputStream os = resp.getOutputStream();
 // now read from one stream and write to the other
 byte[] buffer = new byte[1024];
 int len = in.read(buffer);
 while (len != -1) {
  out.write(buffer, 0, len);
  len = in.read(buffer);
 }
}

代码示例来源:origin: org.jboss.resteasy/async-http-tomcat6

@Override
  public void setFailure(Exception ex)
  {
   try
   {
     dispatcher.asynchronousDelivery(Tomcat6AsyncHttpRequest.this, httpResponse, ex);
     try
     {
      httpResponse.getOutputStream().flush();
     }
     catch (IOException e)
     {
     }
   }
   finally
   {
     try
     {
      event.close();
     }
     catch (IOException ignored)
     {
     }
   }
  }
};

代码示例来源:origin: org.jboss.resteasy/resteasy-core

public void doWrite(Object toOutput, Class type, Type genericType,
          MediaType mediaType, Annotation[] annotations,
          MultivaluedMap<String, Object> requestHeaders,
          OutputStream outputStream) throws IOException
{
 final Map<String, Object> attributes = new HashMap<String, Object>();
 AbstractWriterInterceptorContext messageBodyWriterContext = new ClientWriterInterceptorContext(interceptors, factory, toOutput, type,
     genericType, annotations, mediaType, requestHeaders, outputStream, attributes);
 messageBodyWriterContext
     .proceed();
}

代码示例来源:origin: org.jboss.resteasy/resteasy-jaxrs-20

public void doWrite(Object toOutput, Class type, Type genericType,
          MediaType mediaType, Annotation[] annotations,
          MultivaluedMap<String, Object> requestHeaders,
          OutputStream outputStream) throws IOException
{
 final Map<String, Object> attributes = new HashMap<String, Object>();
 AbstractWriterInterceptorContext messageBodyWriterContext = new ClientWriterInterceptorContext(interceptors, factory, toOutput, type,
     genericType, annotations, mediaType, requestHeaders, outputStream, attributes);
 messageBodyWriterContext
     .proceed();
}

代码示例来源:origin: org.jboss.resteasy/async-http-tomcat6

public void setResponse(Response response)
{
 try
 {
   setupResponse((ServerResponse) response);
   dispatcher.asynchronousDelivery(Tomcat6AsyncHttpRequest.this, httpResponse, response);
   try
   {
    httpResponse.getOutputStream().flush();
   }
   catch (IOException e)
   {
    throw new RuntimeException(e);
   }
 }
 finally
 {
   try
   {
    event.close();
   }
   catch (IOException ignored)
   {
   }
 }
}

代码示例来源:origin: org.jboss.resteasy/resteasy-jaxrs-20

ResteasyProviderFactory.getInstance(), t -> {
   }, true);
response.getOutputStream().write(SseConstants.EOL);
response.getOutputStream().write(SseConstants.EOL);
response.flushBuffer();
responseFlushed = true;

代码示例来源:origin: org.jboss.resteasy/resteasy-core

ResteasyProviderFactory.getInstance(), t -> {
 }, true);
response.getOutputStream().write(SseConstants.EOL);
response.getOutputStream().write(SseConstants.EOL);
response.flushBuffer();
responseFlushed = true;

代码示例来源:origin: org.jboss.resteasy/resteasy-jaxrs-20

writer.writeTo(event, event.getClass(), null, new Annotation[]
{}, event.getMediaType(), null, bout);
response.getOutputStream().write(bout.toByteArray());
response.flushBuffer();

代码示例来源:origin: org.jboss.resteasy/resteasy-core

response.getOutputStream().write(bout.toByteArray());
response.flushBuffer();

代码示例来源:origin: org.jboss.resteasy/resteasy-jaxrs-20

if (jaxrsResponse.getEntity() == null || response.getOutputStream() == null)
OutputStream os = sendHeaders ? new CommitHeaderOutputStream(response.getOutputStream(), callback) : response.getOutputStream();

代码示例来源:origin: org.jboss.resteasy/resteasy-core

if (entity == null || response.getOutputStream() == null)
OutputStream os = sendHeaders ? new CommitHeaderOutputStream(response.getOutputStream(), callback) : response.getOutputStream();

相关文章