org.atmosphere.cpr
Class AtmosphereRequest.Body

java.lang.Object
  extended by org.atmosphere.cpr.AtmosphereRequest.Body
Enclosing class:
AtmosphereRequest

public static final class AtmosphereRequest.Body
extends Object


Constructor Summary
AtmosphereRequest.Body(String data, byte[] dataBytes, int offset, int length)
           
 
Method Summary
 byte[] asBytes()
          Return the request body as a byte array.
 String asString()
          Return the request body as a String.
 int byteLength()
          The asBytes() length
 int byteOffset()
          The asBytes() offset
 boolean hasBytes()
          True is the body is a byte array
 boolean hasString()
          True is the body is a String
 boolean isEmpty()
          True if this object is empty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtmosphereRequest.Body

public AtmosphereRequest.Body(String data,
                              byte[] dataBytes,
                              int offset,
                              int length)
Method Detail

hasString

public boolean hasString()
True is the body is a String

Returns:
True is the body is a String

hasBytes

public boolean hasBytes()
True is the body is a byte array

Returns:
True is the body is a byte array

asString

public String asString()
Return the request body as a String. If the body was a byte array, this method will return null.

Returns:
the request body as a String. If the body was a byte array, this method will return null.

asBytes

public byte[] asBytes()
Return the request body as a byte array. If the body was String, this method will return null.

Returns:
the request body as a byte array. If the body was String, this method will return null.

byteOffset

public int byteOffset()
The asBytes() offset

Returns:
The asBytes() offset

byteLength

public int byteLength()
The asBytes() length

Returns:
The asBytes() length

isEmpty

public boolean isEmpty()
True if this object is empty

Returns:
True if this object is empty


Copyright © 2014. All Rights Reserved.