new AxMemoryStream()
Creates a memory stream object
- Source:
Methods
GetDataPointer() → {ArrayBuffer}
Gets the ArrayBuffer which holds the data of the stream
- Source:
Returns:
The ArrayBuffer which holds the data of the stream
- Type
- ArrayBuffer
ReadData(destination, size) → {Integer}
Reads data from the memory stream and returns the number of bytes which were successfully read
Parameters:
Name | Type | Description |
---|---|---|
destination |
ArrayBuffer | An array buffer of the appropriate size, into which the read data will be stored |
size |
Integer | Number of bytes to read |
- Source:
Returns:
The number of bytes which were successfully read
- Type
- Integer
Resize(newCapacity)
Resizes the memory stream to the given capacity in bytes. Existing data is saved as possible.
Parameters:
Name | Type | Description |
---|---|---|
newCapacity |
Number | The new capacity after the resize |
- Source:
SetWriteMode(writeMode)
Sets the write mode for the stream
If writing at a position before the end of the stream, depending on the stream's write mode, new data can either overwite bytes ahead of the position or be inserted - pushing the ahead bytes forward.
Parameters:
Name | Type | Description |
---|---|---|
writeMode |
StreamWriteMode | The write mode for the stream |
- Source:
WriteData(data, size) → {Integer}
Writes data to the memory stream and returns the number of bytes which were successfully written
If writing at a position before the end of the stream, depending on the stream's write mode, new data can either overwite bytes ahead of the position or be inserted - pushing the existing data forward.
Parameters:
Name | Type | Description |
---|---|---|
data |
ArrayBuffer | An array buffer which holds the data to be written |
size |
Integer | Number of bytes to write |
- Source:
Returns:
The number of bytes which were successfully written
- Type
- Integer