Beispiel #1
0
 public AvroRandomAccessWriter(IAvroFileValueDef <V> valueDef, string fileName, Codec.Type codec, FileShare share = FileShare.None)
     : base(valueDef, new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite, share), codec)
 {
     Index = new AvroRandomAccessIndex <V>(IndexFileName);
 }
Beispiel #2
0
 public AvroRandomAccessWriter(IAvroFileValueDef <V> valueDef, string fileName, AvroRandomAccessIndex <V> index = null, FileShare share = FileShare.None)
     : base(valueDef, new FileStream(fileName, FileMode.Open, FileAccess.ReadWrite, share))
 {
     Index = index ?? new AvroRandomAccessIndex <V>(IndexFileName);
     if (index == null)
     {
         if (File.Exists(IndexFileName))
         {
             Index.Read();
         }
         else
         {
             BuildIndex();
         }
     }
 }
Beispiel #3
0
 public AvroRandomAccessWriter(IAvroFileValueDef <V> valueDef, FileStream stream, Codec.Type codec)
     : base(valueDef, stream, codec)
 {
     Preconditions.CheckArgument(Stream.CanSeek);
     Index = new AvroRandomAccessIndex <V>(IndexFileName);
 }
Beispiel #4
0
 public AvroRandomAccessWriter(IAvroFileValueDef <V> valueDef, FileStream stream, AvroRandomAccessIndex <V> index)
     : base(valueDef, stream)
 {
     Preconditions.CheckArgument(Stream.CanSeek);
     Index = index ?? new AvroRandomAccessIndex <V>(IndexFileName);
     if (index == null)
     {
         if (File.Exists(IndexFileName))
         {
             Index.Read();
         }
         else
         {
             BuildIndex();
         }
     }
 }
Beispiel #5
0
 public AvroRandomAccessReader(IAvroFileValueDef <V> valueDef, FileStream stream, AvroRandomAccessIndex <V> index = null)
     : base(valueDef, stream)
 {
     Preconditions.CheckArgument(Stream.CanSeek);
     Index = index ?? new AvroRandomAccessIndex <V>(IndexFileName);
     if (index == null)
     {
         Preconditions.CheckState(File.Exists(IndexFileName), "Random access index is not available");
         Index.Read();
     }
 }
Beispiel #6
0
 public AvroRandomAccessReader(IAvroFileValueDef <V> valueDef, string fileName, AvroRandomAccessIndex <V> index = null, FileShare share = FileShare.None)
     : this(valueDef, new FileStream(fileName, FileMode.Open, FileAccess.Read, share), index)
 {
 }
Beispiel #7
0
 public static DocumentAvroRAWriter OpenFile(string fileName, AvroRandomAccessIndex <Document> index = null, FileShare share = FileShare.None)
 {
     return(new DocumentAvroRAWriter(fileName, index, share));
 }
Beispiel #8
0
 public static DocumentAvroRAWriter OpenFile(FileStream stream, AvroRandomAccessIndex <Document> index = null)
 {
     return(new DocumentAvroRAWriter(stream, index));
 }
Beispiel #9
0
 public DocumentAvroRAWriter(string fileName, AvroRandomAccessIndex <Document> index = null, FileShare share = FileShare.None)
     : base(DocAvroFileValueDef.Instance, fileName, index, share)
 {
 }
Beispiel #10
0
 protected DocumentAvroRAWriter(FileStream stream, AvroRandomAccessIndex <Document> index = null)
     : base(DocAvroFileValueDef.Instance, stream, index)
 {
 }
Beispiel #11
0
 public DocumentAvroRAReader(FileStream stream, AvroRandomAccessIndex <Document> index = null)
     : base(DocAvroFileValueDef.Instance, stream, index)
 {
 }