コード例 #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);
 }
コード例 #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();
         }
     }
 }
コード例 #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);
 }
コード例 #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();
         }
     }
 }
コード例 #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();
     }
 }
コード例 #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)
 {
 }
コード例 #7
0
 public static DocumentAvroRAWriter OpenFile(string fileName, AvroRandomAccessIndex <Document> index = null, FileShare share = FileShare.None)
 {
     return(new DocumentAvroRAWriter(fileName, index, share));
 }
コード例 #8
0
 public static DocumentAvroRAWriter OpenFile(FileStream stream, AvroRandomAccessIndex <Document> index = null)
 {
     return(new DocumentAvroRAWriter(stream, index));
 }
コード例 #9
0
 public DocumentAvroRAWriter(string fileName, AvroRandomAccessIndex <Document> index = null, FileShare share = FileShare.None)
     : base(DocAvroFileValueDef.Instance, fileName, index, share)
 {
 }
コード例 #10
0
 protected DocumentAvroRAWriter(FileStream stream, AvroRandomAccessIndex <Document> index = null)
     : base(DocAvroFileValueDef.Instance, stream, index)
 {
 }
コード例 #11
0
 public DocumentAvroRAReader(FileStream stream, AvroRandomAccessIndex <Document> index = null)
     : base(DocAvroFileValueDef.Instance, stream, index)
 {
 }