Class EndiannessReverserIndexInput
- java.lang.Object
-
- org.apache.lucene.store.DataInput
-
- org.apache.lucene.store.IndexInput
-
- org.apache.lucene.store.FilterIndexInput
-
- org.apache.lucene.backward_codecs.store.EndiannessReverserIndexInput
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
final class EndiannessReverserIndexInput extends FilterIndexInput
AIndexInput
wrapper that changes the endianness of the provided index input.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EndiannessReverserIndexInput.EndiannessReverserRandomAccessInput
ARandomAccessInput
wrapper that changes the endianness of the provided index input.
-
Field Summary
-
Fields inherited from class org.apache.lucene.store.FilterIndexInput
in
-
-
Constructor Summary
Constructors Constructor Description EndiannessReverserIndexInput(IndexInput in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexInput
clone()
Returns a clone of this stream.RandomAccessInput
randomAccessSlice(long offset, long length)
Creates a random-access slice of this index input, with the given offset and length.void
readFloats(float[] dst, int offset, int length)
Reads a specified number of floats into an array at the specified offset.int
readInt()
Reads four bytes and returns an int (LE byte order).void
readInts(int[] dst, int offset, int length)
Reads a specified number of ints into an array at the specified offset.long
readLong()
Reads eight bytes and returns a long (LE byte order).void
readLongs(long[] dst, int offset, int length)
Read a specified number of longs.short
readShort()
Reads two bytes and returns a short (LE byte order).IndexInput
slice(java.lang.String sliceDescription, long offset, long length)
Creates a slice of this index input, with the given description, offset, and length.-
Methods inherited from class org.apache.lucene.store.FilterIndexInput
close, getDelegate, getFilePointer, length, readByte, readBytes, seek, unwrap, unwrapOnlyTest
-
Methods inherited from class org.apache.lucene.store.IndexInput
getFullSliceDescription, skipBytes, toString
-
Methods inherited from class org.apache.lucene.store.DataInput
readBytes, readGroupVInt, readGroupVInts, readMapOfStrings, readSetOfStrings, readString, readVInt, readVLong, readZInt, readZLong
-
-
-
-
Constructor Detail
-
EndiannessReverserIndexInput
EndiannessReverserIndexInput(IndexInput in)
-
-
Method Detail
-
readShort
public short readShort() throws java.io.IOException
Description copied from class:DataInput
Reads two bytes and returns a short (LE byte order).- Overrides:
readShort
in classDataInput
- Throws:
java.io.IOException
- See Also:
DataOutput.writeShort(short)
,BitUtil.VH_LE_SHORT
-
readInt
public int readInt() throws java.io.IOException
Description copied from class:DataInput
Reads four bytes and returns an int (LE byte order).- Overrides:
readInt
in classDataInput
- Throws:
java.io.IOException
- See Also:
DataOutput.writeInt(int)
,BitUtil.VH_LE_INT
-
readLong
public long readLong() throws java.io.IOException
Description copied from class:DataInput
Reads eight bytes and returns a long (LE byte order).- Overrides:
readLong
in classDataInput
- Throws:
java.io.IOException
- See Also:
DataOutput.writeLong(long)
,BitUtil.VH_LE_LONG
-
readLongs
public void readLongs(long[] dst, int offset, int length) throws java.io.IOException
Description copied from class:DataInput
Read a specified number of longs.
-
readInts
public void readInts(int[] dst, int offset, int length) throws java.io.IOException
Description copied from class:DataInput
Reads a specified number of ints into an array at the specified offset.
-
readFloats
public void readFloats(float[] dst, int offset, int length) throws java.io.IOException
Description copied from class:DataInput
Reads a specified number of floats into an array at the specified offset.- Overrides:
readFloats
in classDataInput
- Parameters:
dst
- the array to read bytes intooffset
- the offset in the array to start storing floatslength
- the number of floats to read- Throws:
java.io.IOException
-
clone
public IndexInput clone()
Description copied from class:IndexInput
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.
Warning: Lucene never closes cloned
IndexInput
s, it will only callIndexInput.close()
on the original object.If you access the cloned IndexInput after closing the original object, any
readXXX
methods will throwAlreadyClosedException
.This method is NOT thread safe, so if the current
IndexInput
is being used by one thread whileclone
is called by another, disaster could strike.- Overrides:
clone
in classIndexInput
-
slice
public IndexInput slice(java.lang.String sliceDescription, long offset, long length) throws java.io.IOException
Description copied from class:IndexInput
Creates a slice of this index input, with the given description, offset, and length. The slice is sought to the beginning.- Overrides:
slice
in classFilterIndexInput
- Throws:
java.io.IOException
-
randomAccessSlice
public RandomAccessInput randomAccessSlice(long offset, long length) throws java.io.IOException
Description copied from class:IndexInput
Creates a random-access slice of this index input, with the given offset and length.The default implementation calls
IndexInput.slice(java.lang.String, long, long)
, and it doesn't support random access, it implements absolute reads as seek+read.- Overrides:
randomAccessSlice
in classIndexInput
- Throws:
java.io.IOException
-
-