org.glassfish.grizzly.http.server.Request.getNIOReader()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(120)

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

Request.getNIOReader介绍

[英]Returns the NIOReader associated with this Request. This NIOReader will not block while reading content.
[中]返回与此请求关联的NIOReader。该阅读器在阅读内容时不会阻塞。

代码示例

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: javaee/grizzly

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: javaee/grizzly

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: javaee/grizzly

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: javaee/grizzly

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: javaee/grizzly

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: javaee/grizzly

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: javaee/grizzly

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

/**
 * <p>
 * Returns the {@link Reader} associated with this {@link Request}.
 * </p>
 * 
 * By default the returned {@link NIOReader} will work as blocking
 * {@link java.io.Reader}, but it will be possible to call {@link NIOReader#isReady()}
 * or {@link NIOReader#notifyAvailable(org.glassfish.grizzly.ReadHandler)}
 * to avoid blocking.
 * 
 * @return the {@link NIOReader} associated with this {@link Request}.
 *
 * @throws IllegalStateException if {@link #getInputStream()} or
 *  {@link #getNIOInputStream()} has already been called for this request.
 *
 * @since 2.2
 */
public Reader getReader() {
  return getNIOReader();
}

代码示例来源:origin: ch.squaredesk.nova/http

public void service(Request request, Response response) throws Exception {
  response.suspend();
  NIOReader in = request.getNIOReader();
  in.notifyAvailable(new ReadHandler() {
    private char[] inputBuffer = new char[0];

代码示例来源:origin: javaee/grizzly

final NIOReader in = request.getNIOReader(); // return the non-blocking InputStream
final NIOWriter out = response.getNIOWriter();

相关文章

Request类方法