| Property | Defined By | ||
|---|---|---|---|
| bytesAvailable : uint [read-only]
Get number of bytes available for reading. | AIHttpBuffer | ||
| content : ByteArray [read-only] | AIHttpBuffer | ||
| httpResponse : AIHttpResponse [read-only] | AIHttpBuffer | ||
| RESPONSE_CONTENT_DONE : String = response.content.done [static] | AIHttpBuffer | ||
| RESPONSE_CR : String = response.CR [static] | AIHttpBuffer | ||
| RESPONSE_HDR_ALMOST_DONE : String = response.HDR.almose.done [static] | AIHttpBuffer | ||
| RESPONSE_HDR_DONE : String = response.HDR.done [static] | AIHttpBuffer | ||
| RESPONSE_KEY : String = response.key [static] | AIHttpBuffer | ||
| RESPONSE_KEY_SPACE : String = response.key.space [static] | AIHttpBuffer | ||
| RESPONSE_LF : String = response.LF [static] | AIHttpBuffer | ||
| RESPONSE_START : String = response.start [static] | AIHttpBuffer | ||
| RESPONSE_STATUS_CODE : String = response.status.code [static] | AIHttpBuffer | ||
| RESPONSE_STATUS_INFO : String = response.status.info [static] | AIHttpBuffer | ||
| RESPONSE_VALUE : String = response.value [static] | AIHttpBuffer | ||
| RESPONSE_VERSION : String = response.version [static] | AIHttpBuffer | ||
| RESPONSE_WAIT_STATUS : String = response.wait.status [static] | AIHttpBuffer | ||
| RESPONSE_WAIT_STATUS_INFO : String = response.wait.status.info [static] | AIHttpBuffer | ||
| state : String [read-only] | AIHttpBuffer | ||
| Property | Defined By | ||
|---|---|---|---|
| _chunkLength : uint = 0 | AIHttpBuffer | ||
| _content : ByteArray | AIHttpBuffer | ||
| _cursor : uint = 0 | AIHttpBuffer | ||
| _data : ByteArray | AIHttpBuffer | ||
| Method | Defined By | ||
|---|---|---|---|
| AIHttpBuffer | |||
parse():void
parse HTTP response
| AIHttpBuffer | ||
read(bytes:ByteArray):void
Read all data from the current position into the specified byte array. | AIHttpBuffer | ||
readAvailable():ByteArray
Read all available bytes. | AIHttpBuffer | ||
readChunks(onData:Function):Boolean
Read chunked encoding. | AIHttpBuffer | ||
readLine(trim:Boolean = false):String
Read a line from the buffer. | AIHttpBuffer | ||
truncate():void
Take bytes from current position to the end, and put them into new byte array. | AIHttpBuffer | ||
writeBytes(bytes:ByteArray):void
Write bytes to this buffer. | AIHttpBuffer | ||
| _chunkLength | property |
protected var _chunkLength:uint = 0| _content | property |
protected var _content:ByteArray| _cursor | property |
protected var _cursor:uint = 0| _data | property |
protected var _data:ByteArray| bytesAvailable | property |
bytesAvailable:uint [read-only] Get number of bytes available for reading.
public function get bytesAvailable():uint| content | property |
content:ByteArray [read-only] public function get content():ByteArray| httpResponse | property |
httpResponse:AIHttpResponse [read-only] public function get httpResponse():AIHttpResponse| RESPONSE_CONTENT_DONE | property |
public static var RESPONSE_CONTENT_DONE:String = response.content.done| RESPONSE_CR | property |
public static var RESPONSE_CR:String = response.CR| RESPONSE_HDR_ALMOST_DONE | property |
public static var RESPONSE_HDR_ALMOST_DONE:String = response.HDR.almose.done| RESPONSE_HDR_DONE | property |
public static var RESPONSE_HDR_DONE:String = response.HDR.done| RESPONSE_KEY | property |
public static var RESPONSE_KEY:String = response.key| RESPONSE_KEY_SPACE | property |
public static var RESPONSE_KEY_SPACE:String = response.key.space| RESPONSE_LF | property |
public static var RESPONSE_LF:String = response.LF| RESPONSE_START | property |
public static var RESPONSE_START:String = response.start| RESPONSE_STATUS_CODE | property |
public static var RESPONSE_STATUS_CODE:String = response.status.code| RESPONSE_STATUS_INFO | property |
public static var RESPONSE_STATUS_INFO:String = response.status.info| RESPONSE_VALUE | property |
public static var RESPONSE_VALUE:String = response.value| RESPONSE_VERSION | property |
public static var RESPONSE_VERSION:String = response.version| RESPONSE_WAIT_STATUS | property |
public static var RESPONSE_WAIT_STATUS:String = response.wait.status| RESPONSE_WAIT_STATUS_INFO | property |
public static var RESPONSE_WAIT_STATUS_INFO:String = response.wait.status.info| state | property |
state:String [read-only] public function get state():String| AIHttpBuffer | () | Constructor |
public function AIHttpBuffer()| parse | () | method |
public function parse():voidparse HTTP response
| read | () | method |
public function read(bytes:ByteArray):voidRead all data from the current position into the specified byte array.
Parameters
bytes:ByteArray |
| readAvailable | () | method |
public function readAvailable():ByteArrayRead all available bytes.
ReturnsByteArray |
| readChunks | () | method |
public function readChunks(onData:Function):BooleanRead chunked encoding.
Parameters
onData:Function — For each chunk, call function(bytes:ByteArray)
|
Boolean — True if done, and no more chunks, false if there is more data to expect.
TODO: Footers...
|
| readLine | () | method |
public function readLine(trim:Boolean = false):StringRead a line from the buffer.
Parameters
trim:Boolean (default = false) |
String — Next line, or null if there was no newline character found.
|
| truncate | () | method |
public function truncate():voidTake bytes from current position to the end, and put them into new byte array.
| writeBytes | () | method |
public function writeBytes(bytes:ByteArray):voidWrite bytes to this buffer. Appends data, does not rely on current position.
Parameters
bytes:ByteArray |