AvroContainer.CreateWriter<T> Method (Stream, AvroSerializerSettings, Codec)
Note
A newer version of HDInsight .NET SDK is available that uses the Azure Resource Manager (ARM) approach. You are encouraged to use the newer ARM-based version of HDInsight .NET SDK going forward. For instructions on how to use the new HDInsight .NET SDK to create a cluster, see Create HDInsight Linux clusters using .NET SDK. For instructions on how to submit jobs using the new .NET SDK and other approaches, see Submit jobs to an HDInsight cluster. The HDInsight SDK reference for the newer version is available at HDInsight .NET SDK Reference.
Creates a writer of a static C# type.
Namespace: Microsoft.Hadoop.Avro.Container
Assembly: Microsoft.Hadoop.Avro (in Microsoft.Hadoop.Avro.dll)
Syntax
public static IAvroWriter<T> CreateWriter<T>(
Stream stream,
AvroSerializerSettings settings,
Codec codec
)
public:
generic<typename T>
static IAvroWriter<T>^ CreateWriter(
Stream^ stream,
AvroSerializerSettings^ settings,
Codec^ codec
)
static member CreateWriter<'T> :
stream:Stream *
settings:AvroSerializerSettings *
codec:Codec -> IAvroWriter<'T>
Public Shared Function CreateWriter(Of T) (
stream As Stream,
settings As AvroSerializerSettings,
codec As Codec
) As IAvroWriter(Of T)
Parameters
stream
Type: System.IO.StreamThe stream that will contain the resulting Avro object container.
settings
Type: Microsoft.Hadoop.Avro.AvroSerializerSettingsThe serializer settings.
codec
Type: Microsoft.Hadoop.Avro.Container.CodecThe codec.
Return Value
Type: Microsoft.Hadoop.Avro.Container.IAvroWriter<T>
A writer.
Type Parameters
- T
The type of serialized objects.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when any argument is null. |
Remarks
By default, the stream is left open.
See Also
CreateWriter Overload
AvroContainer Class
Microsoft.Hadoop.Avro.Container Namespace
Return to top