
## OptimizedMemoryStream class

Defines a MemoryStream that can contains more standard capacity

The OptimizedMemoryStream type exposes the following members:
## Constructors
| Name | Description |
| :- | :- |
|OptimizedMemoryStream()|Initializes a new instance of the [OptimizedMemoryStream](/pdf/python-net/aspose.pdf/optimizedmemorystream/) class.|
|OptimizedMemoryStream(buffer_size, buffer)|Initializes a new instance of the OptimizedMemoryStream class|
|OptimizedMemoryStream(buffer_size)|Initializes a new instance of the OptimizedMemoryStream class|
|OptimizedMemoryStream(buffer)|Initializes a new instance of the OptimizedMemoryStream class|
## Properties
| Name | Description |
| :- | :- |
|buffer_size|Gets or sets the size of the underlying buffers.|
|free_on_dispose|Gets or sets a value indicating whether to free the underlying buffers on dispose.|
|DEFAULT_BUFFER_SIZE|Default buffer size value in bytes.|
## Methods
| Name | Description |
| :- | :- |
|to_array()|Converts the current stream to a byte array.|
|write_to(stream)|Writes to the specified stream.|

### See Also

* namespace [aspose.pdf](/pdf/python-net/aspose.pdf/)
* assembly [Aspose.PDF](/pdf/python-net/)

