---
title: "CustomFormatReader..::.OpenReader Method (Stream)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_CustomFormatReader_OpenReader_1_bca7c9fe.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# CustomFormatReader.OpenReader Method (Stream)
 
Opens the reader on the specified stream.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Protected Friend MustOverride Sub OpenReader ( _stream As Stream _
)
```
 
```csharp
protected internal abstract void OpenReader(Stream stream
)
```
 
### Parameters
 
 - stream
     - Type: [System.IO.Stream](http://msdn2.microsoft.com/en-us/8f86tw9e)
 [Stream](http://msdn2.microsoft.com/en-us/8f86tw9e) to open the reader on.
 
## Examples
  
```csharp
protected override void OpenReader(System.IO.Stream stream)
{
    _stream = stream;

    try
    {
        //Initialize the reader using a custom helper method
        //NOTE: this method is not a part of the CustomFormatReader class, and you
        //have to add it yourself
        InitializeReader();            
    }
    catch
    {
        CloseReader();
        throw;
    }
}
```
   
## See Also

### Reference

- [CustomFormatReader Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_CustomFormatReader.htm.md)
- [OpenReader Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Codecs_CustomFormatReader_OpenReader.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
