org.apache.coyote.Request.doRead()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(194)

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

Request.doRead介绍

[英]Read data from the input buffer and put it into a byte chunk. The buffer is owned by the protocol implementation - it will be reused on the next read. The Adapter must either process the data in place or copy it to a separate buffer if it needs to hold it. In most cases this is done during byte->char conversions or via InputStream. Unlike InputStream, this interface allows the app to process data in place, without copy.
[中]从输入缓冲区读取数据并将其放入字节块。缓冲区归协议实现所有——它将在下次读取时重新使用。适配器必须就地处理数据,或者在需要保存数据时将其复制到单独的缓冲区。在大多数情况下,这是在字节->字符转换期间或通过InputStream完成的。与InputStream不同,该接口允许应用程序就地处理数据,无需复制。

代码示例

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

/**
 * Reads new bytes in the byte chunk.
 *
 * @throws IOException An underlying IOException occurred
 */
@Override
public int realReadBytes() throws IOException {
  if (closed) {
    return -1;
  }
  if (coyoteRequest == null) {
    return -1;
  }
  if (state == INITIAL_STATE) {
    state = BYTE_STATE;
  }
  int result = coyoteRequest.doRead(this);
  return result;
}

代码示例来源:origin: tomcat/catalina

/** 
 * Reads new bytes in the byte chunk.
 * 
 * @param cbuf Byte buffer to be written to the response
 * @param off Offset
 * @param len Length
 * 
 * @throws IOException An underlying IOException occurred
 */
public int realReadBytes(byte cbuf[], int off, int len)
  throws IOException {
  if (closed)
    return -1;
  if (coyoteRequest == null)
    return -1;
  state = BYTE_STATE;
  int result = coyoteRequest.doRead(bb);
  return result;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Reads new bytes in the byte chunk.
 *
 * @throws IOException An underlying IOException occurred
 */
@Override
public int realReadBytes() throws IOException {
  if (closed) {
    return -1;
  }
  if (coyoteRequest == null) {
    return -1;
  }
  if (state == INITIAL_STATE) {
    state = BYTE_STATE;
  }
  int result = coyoteRequest.doRead(this);
  return result;
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

/** 
 * Reads new bytes in the byte chunk.
 * 
 * @param cbuf Byte buffer to be written to the response
 * @param off Offset
 * @param len Length
 * 
 * @throws IOException An underlying IOException occurred
 */
public int realReadBytes(byte cbuf[], int off, int len)
    throws IOException {
  if (closed)
    return -1;
  if (coyoteRequest == null)
    return -1;
  if(state == INITIAL_STATE)
    state = BYTE_STATE;
  int result = coyoteRequest.doRead(bb);
  return result;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/** 
 * Reads new bytes in the byte chunk.
 * 
 * @param cbuf Byte buffer to be written to the response
 * @param off Offset
 * @param len Length
 * 
 * @throws IOException An underlying IOException occurred
 */
public int realReadBytes(byte cbuf[], int off, int len)
    throws IOException {
  if (closed)
    return -1;
  if (coyoteRequest == null)
    return -1;
  if(state == INITIAL_STATE)
    state = BYTE_STATE;
  int result = coyoteRequest.doRead(bb);
  return result;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

/** 
 * Reads new bytes in the byte chunk.
 * 
 * @param cbuf Byte buffer to be written to the response
 * @param off Offset
 * @param len Length
 * 
 * @throws IOException An underlying IOException occurred
 */
public int realReadBytes(byte cbuf[], int off, int len)
    throws IOException {
  if (closed)
    return -1;
  if (coyoteRequest == null)
    return -1;
  if(state == INITIAL_STATE)
    state = BYTE_STATE;
  int result = coyoteRequest.doRead(bb);
  return result;
}

代码示例来源:origin: jboss.remoting/jboss-remoting

/**
* Reads new bytes in the byte chunk.
*
* @param cbuf Byte buffer to be written to the response
* @param off  Offset
* @param len  Length
* @throws IOException An underlying IOException occurred
*/
public int realReadBytes(byte cbuf[], int off, int len)
   throws IOException
{
 if(closed)
 {
   return -1;
 }
 if(coyoteRequest == null)
 {
   return -1;
 }
 state = BYTE_STATE;
 int result = coyoteRequest.doRead(bb);
 return result;
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Reads new bytes in the byte chunk.
 *
 * @param cbuf Byte buffer to be written to the response
 * @param off Offset
 * @param len Length
 *
 * @throws IOException An underlying IOException occurred
 */
@Override
public int realReadBytes(byte cbuf[], int off, int len)
    throws IOException {
  if (closed) {
    return -1;
  }
  if (coyoteRequest == null) {
    return -1;
  }
  if(state == INITIAL_STATE) {
    state = BYTE_STATE;
  }
  int result = coyoteRequest.doRead(bb);
  return result;
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Reads new bytes in the byte chunk.
 *
 * @param cbuf Byte buffer to be written to the response
 * @param off Offset
 * @param len Length
 *
 * @throws IOException An underlying IOException occurred
 */
@Override
public int realReadBytes(byte cbuf[], int off, int len)
    throws IOException {
  if (closed) {
    return -1;
  }
  if (coyoteRequest == null) {
    return -1;
  }
  if(state == INITIAL_STATE) {
    state = BYTE_STATE;
  }
  int result = coyoteRequest.doRead(bb);
  return result;
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Reads new bytes in the byte chunk.
 *
 * @param cbuf Byte buffer to be written to the response
 * @param off Offset
 * @param len Length
 *
 * @throws IOException An underlying IOException occurred
 */
@Override
public int realReadBytes(byte cbuf[], int off, int len)
    throws IOException {
  if (closed) {
    return -1;
  }
  if (coyoteRequest == null) {
    return -1;
  }
  if(state == INITIAL_STATE) {
    state = BYTE_STATE;
  }
  int result = coyoteRequest.doRead(bb);
  return result;
}

代码示例来源:origin: jboss.web/jbossweb

int n = coyoteRequest.doRead(bb);
if (n < 0) {
  eof = true;

代码示例来源:origin: org.jboss.web/jbossweb

int n = coyoteRequest.doRead(bb);
if (n < 0) {
  eof = true;

相关文章

Request类方法