Show / Hide Table of Contents

# Class ServiceBufferFileStreamWriter

Writer for service buffer formatted file streams

##### Inheritance

System.Object
ServiceBufferFileStreamWriter

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace:Microsoft.SqlTools.ServiceLayer.QueryExecution.DataStorage

###### Assembly:Microsoft.SqlTools.ServiceLayer.dll

##### Syntax

    public class ServiceBufferFileStreamWriter : IFileStreamWriter, IDisposable

### Constructors

| Improve this Doc View Source

#### ServiceBufferFileStreamWriter(Stream, Int32, Int32)

Constructs a new writer

##### Declaration

    public ServiceBufferFileStreamWriter(Stream stream, int maxCharsToStore, int maxXmlCharsToStore)

##### Parameters

Type | Name | Description
--- | --- | ---
System.IO.Stream | stream | The file wrapper to use as the underlying file stream
System.Int32 | maxCharsToStore | Maximum number of characters to store for long text fields
System.Int32 | maxXmlCharsToStore | Maximum number of characters to store for XML fields

### Methods

| Improve this Doc View Source

#### Dispose()

##### Declaration

    public void Dispose()

##### Implements

System.IDisposable.Dispose()
| Improve this Doc View Source

#### Dispose(Boolean)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | disposing |

| Improve this Doc View Source

#### Finalize()

##### Declaration

    protected void Finalize()

| Improve this Doc View Source

#### FlushBuffer()

Flushes the internal buffer to the file stream

##### Declaration

    public void FlushBuffer()

##### Implements

IFileStreamWriter.FlushBuffer()
| Improve this Doc View Source

#### WriteBoolean(Boolean)

Writes a bool to the file

##### Declaration

    public int WriteBoolean(bool val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the bool

##### Implements

IFileStreamWriter.WriteBoolean(Boolean)
| Improve this Doc View Source

#### WriteByte(Byte)

Writes a byte to the file

##### Declaration

    public int WriteByte(byte val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Byte | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the byte

##### Implements

IFileStreamWriter.WriteByte(Byte)
| Improve this Doc View Source

#### WriteBytes(Byte[])

Writes a byte[] to the file

##### Declaration

    public int WriteBytes(byte[] bytesVal)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Byte[] | bytesVal |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the byte[]

##### Implements

IFileStreamWriter.WriteBytes(Byte[])
| Improve this Doc View Source

#### WriteChar(Char)

Writes a char to the file

##### Declaration

    public int WriteChar(char val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Char | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the char

##### Implements

IFileStreamWriter.WriteChar(Char)
| Improve this Doc View Source

#### WriteDateTime(DbColumnWrapper, DateTime)

Writes a DateTime to the file as precision and ticks

##### Declaration

    public int WriteDateTime(DbColumnWrapper col, DateTime dtVal)

##### Parameters

Type | Name | Description
--- | --- | ---
DbColumnWrapper | col |
System.DateTime | dtVal |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the DateTime

##### Implements

IFileStreamWriter.WriteDateTime(DbColumnWrapper, DateTime)
| Improve this Doc View Source

#### WriteDateTimeOffset(DateTimeOffset)

Writes a DateTimeOffset to the file

##### Declaration

    public int WriteDateTimeOffset(DateTimeOffset dtoVal)

##### Parameters

Type | Name | Description
--- | --- | ---
System.DateTimeOffset | dtoVal |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the DateTimeOffset

##### Implements

IFileStreamWriter.WriteDateTimeOffset(DateTimeOffset)
| Improve this Doc View Source

#### WriteDecimal(Decimal)

Writes a decimal to the file

##### Declaration

    public int WriteDecimal(decimal val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Decimal | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the decimal

##### Implements

IFileStreamWriter.WriteDecimal(Decimal)
| Improve this Doc View Source

#### WriteDouble(Double)

Writes a double to the file

##### Declaration

    public int WriteDouble(double val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Double | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the double

##### Implements

IFileStreamWriter.WriteDouble(Double)
| Improve this Doc View Source

#### WriteGuid(Guid)

Stores a GUID value to the file by treating it as a byte array

##### Declaration

    public int WriteGuid(Guid val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Guid | val | The GUID to write to the file

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes written to the file

##### Implements

IFileStreamWriter.WriteGuid(Guid)
| Improve this Doc View Source

#### WriteInt16(Int16)

Writes a short to the file

##### Declaration

    public int WriteInt16(short val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int16 | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the short

##### Implements

IFileStreamWriter.WriteInt16(Int16)
| Improve this Doc View Source

#### WriteInt32(Int32)

Writes a int to the file

##### Declaration

    public int WriteInt32(int val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the int

##### Implements

IFileStreamWriter.WriteInt32(Int32)
| Improve this Doc View Source

#### WriteInt64(Int64)

Writes a long to the file

##### Declaration

    public int WriteInt64(long val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int64 | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the long

##### Implements

IFileStreamWriter.WriteInt64(Int64)
| Improve this Doc View Source

#### WriteMoney(SqlMoney)

Stores a SqlMoney value to the file by treating it as a decimal

##### Declaration

    public int WriteMoney(SqlMoney val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Data.SqlTypes.SqlMoney | val | The SqlMoney value to write to the file

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes written to the file

##### Implements

IFileStreamWriter.WriteMoney(SqlMoney)
| Improve this Doc View Source

#### WriteNull()

Writes null to the file as one 0x00 byte

##### Declaration

    public int WriteNull()

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the null

##### Implements

IFileStreamWriter.WriteNull()
| Improve this Doc View Source

#### WriteRow(StorageDataReader)

Writes an entire row to the file stream

##### Declaration

    public int WriteRow(StorageDataReader reader)

##### Parameters

Type | Name | Description
--- | --- | ---
StorageDataReader | reader | A primed reader

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to write the row

##### Implements

IFileStreamWriter.WriteRow(StorageDataReader)
| Improve this Doc View Source

#### WriteSingle(Single)

Writes a float to the file

##### Declaration

    public int WriteSingle(float val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Single | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the float

##### Implements

IFileStreamWriter.WriteSingle(Single)
| Improve this Doc View Source

#### WriteSqlDecimal(SqlDecimal)

Writes a SqlDecimal to the file

##### Declaration

    public int WriteSqlDecimal(SqlDecimal val)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Data.SqlTypes.SqlDecimal | val |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the SqlDecimal

##### Implements

IFileStreamWriter.WriteSqlDecimal(SqlDecimal)
| Improve this Doc View Source

#### WriteString(String)

Writes a string to the file

##### Declaration

    public int WriteString(string sVal)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | sVal |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the string

##### Implements

IFileStreamWriter.WriteString(String)
| Improve this Doc View Source

#### WriteTimeSpan(TimeSpan)

Writes a TimeSpan to the file

##### Declaration

    public int WriteTimeSpan(TimeSpan timeSpan)

##### Parameters

Type | Name | Description
--- | --- | ---
System.TimeSpan | timeSpan |

##### Returns

Type | Description
--- | ---
System.Int32 | Number of bytes used to store the TimeSpan

##### Implements

IFileStreamWriter.WriteTimeSpan(TimeSpan)