/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Avro.File { public interface IFileReader : IDisposable { /// /// Return the header for the input /// file / stream /// /// Header GetHeader(); /// /// Return the schema as read from /// the input file / stream /// /// Schema GetSchema(); /// /// Return the list of keys in the metadata /// /// ICollection GetMetaKeys(); /// /// Return an enumeration of the remaining entries in the file /// /// IEnumerable NextEntries { get; } /// /// Read the next datum from the file. /// T Next(); /// /// True if more entries remain in this file. /// bool HasNext(); /// /// Return the byte value of a metadata property /// /// /// byte[] GetMeta(string key); /// /// Return the long value of a metadata property /// /// /// long GetMetaLong(string key); /// /// Return the string value of a metadata property /// /// /// string GetMetaString(string key); /// /// Return true if past the next synchronization /// point after a position /// /// /// bool PastSync(long position); /// /// Return the last synchronization point before /// our current position /// /// long PreviousSync(); /// /// Move to a specific, known synchronization point, /// one returned from IFileWriter.Sync() while writing /// /// void Seek(long position); /// /// Move to the next synchronization point /// after a position /// /// void Sync(long position); /// /// Return the current position in the input /// /// long Tell(); } }