@Deprecated public final class ByteArrayIndexInput extends IndexInput implements RandomAccessInput
IndexInput
backed by a byte array.Constructor and Description |
---|
ByteArrayIndexInput(String description,
byte[] bytes)
Deprecated.
|
ByteArrayIndexInput(String description,
byte[] bytes,
int offs,
int length)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
IndexInput |
clone()
Deprecated.
Returns a clone of this stream.
|
void |
close()
Deprecated.
Closes the stream to further operations.
|
long |
getFilePointer()
Deprecated.
Returns the current position in this file, where the next read will
occur.
|
long |
length()
Deprecated.
The number of bytes in the file.
|
byte |
readByte()
Deprecated.
Reads and returns a single byte.
|
byte |
readByte(long pos)
Deprecated.
Reads a byte at the given position in the file
|
void |
readBytes(byte[] b,
int offset,
int len)
Deprecated.
Reads a specified number of bytes into an array at the specified offset.
|
int |
readInt()
Deprecated.
Reads four bytes and returns an int.
|
int |
readInt(long pos)
Deprecated.
Reads an integer at the given position in the file
|
long |
readLong()
Deprecated.
Reads eight bytes and returns a long.
|
long |
readLong(long pos)
Deprecated.
Reads a long at the given position in the file
|
short |
readShort()
Deprecated.
Reads two bytes and returns a short.
|
short |
readShort(long pos)
Deprecated.
Reads a short at the given position in the file
|
int |
readVInt()
Deprecated.
Reads an int stored in variable-length format.
|
long |
readVLong()
Deprecated.
Reads a long stored in variable-length format.
|
void |
seek(long pos)
Deprecated.
Sets current position in this file, where the next read will occur.
|
ByteArrayIndexInput |
slice(String sliceDescription,
long offset,
long length)
Deprecated.
Creates a slice of this index input, with the given description, offset, and length.
|
getFullSliceDescription, randomAccessSlice, toString
readBytes, readMapOfStrings, readSetOfStrings, readString, readZInt, readZLong, skipBytes
public ByteArrayIndexInput(String description, byte[] bytes)
public ByteArrayIndexInput(String description, byte[] bytes, int offs, int length)
public long getFilePointer()
IndexInput
getFilePointer
in class IndexInput
IndexInput.seek(long)
public void seek(long pos) throws EOFException
IndexInput
EOFException
and then the
stream is in an undetermined state.seek
in class IndexInput
EOFException
IndexInput.getFilePointer()
public long length()
IndexInput
length
in class IndexInput
public short readShort()
DataInput
readShort
in class DataInput
DataOutput.writeByte(byte)
public int readInt()
DataInput
readInt
in class DataInput
DataOutput.writeInt(int)
public long readLong()
DataInput
readLong
in class DataInput
DataOutput.writeLong(long)
public int readVInt()
DataInput
The format is described further in DataOutput.writeVInt(int)
.
readVInt
in class DataInput
DataOutput.writeVInt(int)
public long readVLong()
DataInput
The format is described further in DataOutput.writeVInt(int)
.
readVLong
in class DataInput
DataOutput.writeVLong(long)
public byte readByte()
DataInput
readByte
in class DataInput
DataOutput.writeByte(byte)
public void readBytes(byte[] b, int offset, int len)
DataInput
readBytes
in class DataInput
b
- the array to read bytes intooffset
- the offset in the array to start storing byteslen
- the number of bytes to readDataOutput.writeBytes(byte[],int)
public void close()
IndexInput
close
in interface Closeable
close
in interface AutoCloseable
close
in class IndexInput
public IndexInput clone()
IndexInput
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 call IndexInput.close()
on the original object.
If you access the cloned IndexInput after closing the original object,
any readXXX
methods will throw AlreadyClosedException
.
This method is NOT thread safe, so if the current IndexInput
is being used by one thread while clone
is called by another,
disaster could strike.
clone
in class IndexInput
public ByteArrayIndexInput slice(String sliceDescription, long offset, long length)
IndexInput
slice
in class IndexInput
public byte readByte(long pos) throws IOException
RandomAccessInput
readByte
in interface RandomAccessInput
IOException
DataInput.readByte()
public short readShort(long pos) throws IOException
RandomAccessInput
readShort
in interface RandomAccessInput
IOException
DataInput.readShort()
public int readInt(long pos) throws IOException
RandomAccessInput
readInt
in interface RandomAccessInput
IOException
DataInput.readInt()
public long readLong(long pos) throws IOException
RandomAccessInput
readLong
in interface RandomAccessInput
IOException
DataInput.readLong()
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.