Example usage for javax.servlet ServletInputStream available

List of usage examples for javax.servlet ServletInputStream available

Introduction

In this page you can find the example usage for javax.servlet ServletInputStream available.

Prototype

public int available() throws IOException 

Source Link

Document

Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking, which may be 0, or 0 when end of stream is detected.

Usage

From source file:com.orinus.script.safe.jetty.SRequest.java

public byte[] getRequestData() {
    byte[] tag = new byte[0];
    try {/* ww w . j  a  v a  2s. co m*/
        ServletInputStream sis = req.getInputStream();
        tag = new byte[sis.available()];
        sis.read(tag);
    } catch (Exception e) {
    }
    return tag;
}