com.sun.grizzly.tcp.http11.GrizzlyResponse.getOutputStream()方法的使用及代码示例

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

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

GrizzlyResponse.getOutputStream介绍

[英]Return the servlet output stream associated with this Response.
[中]返回与此响应关联的servlet输出流。

代码示例

代码示例来源:origin: org.jvnet.jax-ws-commons/jaxws-grizzly-httpspi

@Override
public OutputStream getResponseBody() throws IOException {
  return response.getOutputStream();
}

代码示例来源:origin: com.sun.grizzly/grizzly-utils

} catch (IllegalStateException ise1) {
  try {
    getOutputStream().print(sb.toString());
  } catch (IllegalStateException ise2) {

代码示例来源:origin: com.sun.jersey/jersey-bundle

public OutputStream writeStatusAndHeaders(long contentLength, 
    ContainerResponse cResponse) throws IOException {
  final javax.ws.rs.core.Response.StatusType statusInfo = cResponse.getStatusType();
  if (statusInfo.getReasonPhrase() == null) {
    response.setStatus(statusInfo.getStatusCode());
  } else {
    response.setStatus(statusInfo.getStatusCode(), statusInfo.getReasonPhrase());
  }
  if (contentLength != -1 && contentLength < Integer.MAX_VALUE) 
    response.setContentLength((int)contentLength);
  for (Map.Entry<String, List<Object>> e : cResponse.getHttpHeaders().entrySet()) {
    for (Object value : e.getValue()) {
      response.addHeader(e.getKey(), ContainerResponse.getHeaderValue(value));
    }
  }
  String contentType = response.getHeader("Content-Type");
  if (contentType != null) {
    response.setContentType(contentType);
  }
    
  return response.getOutputStream();
}

相关文章

微信公众号

最新文章

更多