C# Класс Lucene.Net.Store.DataInput

Abstract base class for performing read operations of Lucene's low-level data types.

{@code DataInput} may only be used from one thread, because it is not thread safe (it keeps internal state like file position). To allow multithreaded use, every {@code DataInput} instance must be cloned before used in another thread. Subclasses must therefore implement #clone(), returning a new {@code DataInput} which operates on the same underlying resource, but positioned independently.

Наследование: ICloneable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Clone ( ) : object

Returns a clone of this stream.

Clones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.

Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.

ReadByte ( ) : byte

Reads and returns a single byte.

ReadBytes ( byte b, int offset, int len ) : void

Reads a specified number of bytes into an array at the specified offset.

ReadBytes ( byte b, int offset, int len, bool useBuffer ) : void

Reads a specified number of bytes into an array at the specified offset with control over whether the read should be buffered (callers who have their own buffer should pass in "false" for useBuffer). Currently only BufferedIndexInput respects this parameter.

ReadInt ( ) : int

Reads four bytes and returns an int.

ReadLong ( ) : long

Reads eight bytes and returns a long.

ReadShort ( ) : short

Reads two bytes and returns a short. LUCENENET NOTE: Important - always cast to ushort (System.UInt16) before using to ensure the value is positive!

ReadString ( ) : string

Reads a string.

ReadStringSet ( ) : ISet

Reads a Set<String> previously written with DataOutput#writeStringSet(Set).

ReadStringStringMap ( ) : string>.IDictionary

Reads a Map<String,String> previously written with DataOutput#writeStringStringMap(Map).

ReadVInt ( ) : int

Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

The format is described further in DataOutput#writeVInt(int).

ReadVLong ( ) : long

Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

The format is described further in DataOutput#writeVInt(int).

SkipBytes ( long numBytes ) : void

Skip over numBytes bytes. The contract on this method is that it should have the same behavior as reading the same number of bytes into a buffer and discarding its content. Negative values of numBytes are not supported.

Описание методов

Clone() публичный Метод

Returns a clone of this stream.

Clones of a stream access the same data, and are positioned at the same point as the stream they were cloned from.

Expert: Subclasses must ensure that clones may be positioned at different points in the input from each other and from the stream they were cloned from.

public Clone ( ) : object
Результат object

ReadByte() публичный абстрактный Метод

Reads and returns a single byte.
public abstract ReadByte ( ) : byte
Результат byte

ReadBytes() публичный абстрактный Метод

Reads a specified number of bytes into an array at the specified offset.
public abstract ReadBytes ( byte b, int offset, int len ) : void
b byte the array to read bytes into
offset int the offset in the array to start storing bytes
len int the number of bytes to read
Результат void

ReadBytes() публичный Метод

Reads a specified number of bytes into an array at the specified offset with control over whether the read should be buffered (callers who have their own buffer should pass in "false" for useBuffer). Currently only BufferedIndexInput respects this parameter.
public ReadBytes ( byte b, int offset, int len, bool useBuffer ) : void
b byte the array to read bytes into
offset int the offset in the array to start storing bytes
len int the number of bytes to read
useBuffer bool set to false if the caller will handle /// buffering.
Результат void

ReadInt() публичный Метод

Reads four bytes and returns an int.
public ReadInt ( ) : int
Результат int

ReadLong() публичный Метод

Reads eight bytes and returns a long.
public ReadLong ( ) : long
Результат long

ReadShort() публичный Метод

Reads two bytes and returns a short. LUCENENET NOTE: Important - always cast to ushort (System.UInt16) before using to ensure the value is positive!
public ReadShort ( ) : short
Результат short

ReadString() публичный Метод

Reads a string.
public ReadString ( ) : string
Результат string

ReadStringSet() публичный Метод

Reads a Set<String> previously written with DataOutput#writeStringSet(Set).
public ReadStringSet ( ) : ISet
Результат ISet

ReadStringStringMap() публичный Метод

Reads a Map<String,String> previously written with DataOutput#writeStringStringMap(Map).
public ReadStringStringMap ( ) : string>.IDictionary
Результат string>.IDictionary

ReadVInt() публичный Метод

Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

The format is described further in DataOutput#writeVInt(int).

public ReadVInt ( ) : int
Результат int

ReadVLong() публичный Метод

Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

The format is described further in DataOutput#writeVInt(int).

public ReadVLong ( ) : long
Результат long

SkipBytes() публичный Метод

Skip over numBytes bytes. The contract on this method is that it should have the same behavior as reading the same number of bytes into a buffer and discarding its content. Negative values of numBytes are not supported.
public SkipBytes ( long numBytes ) : void
numBytes long
Результат void