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

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

本文整理了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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @throws IOException An underlying IOException occurred
  5. */
  6. @Override
  7. public int realReadBytes() throws IOException {
  8. if (closed) {
  9. return -1;
  10. }
  11. if (coyoteRequest == null) {
  12. return -1;
  13. }
  14. if (state == INITIAL_STATE) {
  15. state = BYTE_STATE;
  16. }
  17. int result = coyoteRequest.doRead(this);
  18. return result;
  19. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @param cbuf Byte buffer to be written to the response
  5. * @param off Offset
  6. * @param len Length
  7. *
  8. * @throws IOException An underlying IOException occurred
  9. */
  10. public int realReadBytes(byte cbuf[], int off, int len)
  11. throws IOException {
  12. if (closed)
  13. return -1;
  14. if (coyoteRequest == null)
  15. return -1;
  16. state = BYTE_STATE;
  17. int result = coyoteRequest.doRead(bb);
  18. return result;
  19. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @throws IOException An underlying IOException occurred
  5. */
  6. @Override
  7. public int realReadBytes() throws IOException {
  8. if (closed) {
  9. return -1;
  10. }
  11. if (coyoteRequest == null) {
  12. return -1;
  13. }
  14. if (state == INITIAL_STATE) {
  15. state = BYTE_STATE;
  16. }
  17. int result = coyoteRequest.doRead(this);
  18. return result;
  19. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @param cbuf Byte buffer to be written to the response
  5. * @param off Offset
  6. * @param len Length
  7. *
  8. * @throws IOException An underlying IOException occurred
  9. */
  10. public int realReadBytes(byte cbuf[], int off, int len)
  11. throws IOException {
  12. if (closed)
  13. return -1;
  14. if (coyoteRequest == null)
  15. return -1;
  16. if(state == INITIAL_STATE)
  17. state = BYTE_STATE;
  18. int result = coyoteRequest.doRead(bb);
  19. return result;
  20. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @param cbuf Byte buffer to be written to the response
  5. * @param off Offset
  6. * @param len Length
  7. *
  8. * @throws IOException An underlying IOException occurred
  9. */
  10. public int realReadBytes(byte cbuf[], int off, int len)
  11. throws IOException {
  12. if (closed)
  13. return -1;
  14. if (coyoteRequest == null)
  15. return -1;
  16. if(state == INITIAL_STATE)
  17. state = BYTE_STATE;
  18. int result = coyoteRequest.doRead(bb);
  19. return result;
  20. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @param cbuf Byte buffer to be written to the response
  5. * @param off Offset
  6. * @param len Length
  7. *
  8. * @throws IOException An underlying IOException occurred
  9. */
  10. public int realReadBytes(byte cbuf[], int off, int len)
  11. throws IOException {
  12. if (closed)
  13. return -1;
  14. if (coyoteRequest == null)
  15. return -1;
  16. if(state == INITIAL_STATE)
  17. state = BYTE_STATE;
  18. int result = coyoteRequest.doRead(bb);
  19. return result;
  20. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @param cbuf Byte buffer to be written to the response
  5. * @param off Offset
  6. * @param len Length
  7. * @throws IOException An underlying IOException occurred
  8. */
  9. public int realReadBytes(byte cbuf[], int off, int len)
  10. throws IOException
  11. {
  12. if(closed)
  13. {
  14. return -1;
  15. }
  16. if(coyoteRequest == null)
  17. {
  18. return -1;
  19. }
  20. state = BYTE_STATE;
  21. int result = coyoteRequest.doRead(bb);
  22. return result;
  23. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @param cbuf Byte buffer to be written to the response
  5. * @param off Offset
  6. * @param len Length
  7. *
  8. * @throws IOException An underlying IOException occurred
  9. */
  10. @Override
  11. public int realReadBytes(byte cbuf[], int off, int len)
  12. throws IOException {
  13. if (closed) {
  14. return -1;
  15. }
  16. if (coyoteRequest == null) {
  17. return -1;
  18. }
  19. if(state == INITIAL_STATE) {
  20. state = BYTE_STATE;
  21. }
  22. int result = coyoteRequest.doRead(bb);
  23. return result;
  24. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @param cbuf Byte buffer to be written to the response
  5. * @param off Offset
  6. * @param len Length
  7. *
  8. * @throws IOException An underlying IOException occurred
  9. */
  10. @Override
  11. public int realReadBytes(byte cbuf[], int off, int len)
  12. throws IOException {
  13. if (closed) {
  14. return -1;
  15. }
  16. if (coyoteRequest == null) {
  17. return -1;
  18. }
  19. if(state == INITIAL_STATE) {
  20. state = BYTE_STATE;
  21. }
  22. int result = coyoteRequest.doRead(bb);
  23. return result;
  24. }

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

  1. /**
  2. * Reads new bytes in the byte chunk.
  3. *
  4. * @param cbuf Byte buffer to be written to the response
  5. * @param off Offset
  6. * @param len Length
  7. *
  8. * @throws IOException An underlying IOException occurred
  9. */
  10. @Override
  11. public int realReadBytes(byte cbuf[], int off, int len)
  12. throws IOException {
  13. if (closed) {
  14. return -1;
  15. }
  16. if (coyoteRequest == null) {
  17. return -1;
  18. }
  19. if(state == INITIAL_STATE) {
  20. state = BYTE_STATE;
  21. }
  22. int result = coyoteRequest.doRead(bb);
  23. return result;
  24. }

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

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

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

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

相关文章

Request类方法