Class SimpleFileInput
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.wal.io.SimpleFileInput
-
- All Implemented Interfaces:
DataInput,ByteBufferBackedDataInput,FileInput
public class SimpleFileInput extends Object implements FileInput
File input, backed by byte buffer file input. This class allows to read data by chunks from file and then read primitives
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.processors.cache.persistence.wal.io.FileInput
FileInput.Crc32CheckingFileInput
-
-
Constructor Summary
Constructors Constructor Description SimpleFileInput(FileIO io, ByteBufferExpander buf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBufferbuffer()voidensure(int requested)ensure that requested count of byte is available in data input and will try to load data if notFileIOio()File I/O.longposition()booleanreadBoolean()bytereadByte()charreadChar()doublereadDouble()floatreadFloat()voidreadFully(@org.jetbrains.annotations.NotNull byte[] b)voidreadFully(@org.jetbrains.annotations.NotNull byte[] b, int off, int len)intreadInt()StringreadLine()longreadLong()shortreadShort()intreadUnsignedByte()intreadUnsignedShort()StringreadUTF()voidseek(long pos)intskipBytes(int n)FileInput.Crc32CheckingFileInputstartRead(boolean skipCheck)
-
-
-
Field Detail
-
io
protected FileIO io
I/O interface for read/write operations with file
-
-
Constructor Detail
-
SimpleFileInput
public SimpleFileInput(FileIO io, ByteBufferExpander buf) throws IOException
- Parameters:
io- FileIO to read from.buf- Buffer for reading blocks of data into.- Throws:
IOException
-
-
Method Detail
-
seek
public void seek(long pos) throws IOException- Specified by:
seekin interfaceFileInput- Parameters:
pos- Position in bytes from file begin.- Throws:
IOException
-
buffer
public ByteBuffer buffer()
- Specified by:
bufferin interfaceByteBufferBackedDataInput- Returns:
- Underlying buffer.
-
ensure
public void ensure(int requested) throws IOExceptionensure that requested count of byte is available in data input and will try to load data if not- Specified by:
ensurein interfaceByteBufferBackedDataInput- Parameters:
requested- Requested number of bytes.- Throws:
IOException- If failed.
-
position
public long position()
-
readFully
public void readFully(@NotNull @org.jetbrains.annotations.NotNull byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
public void readFully(@NotNull @org.jetbrains.annotations.NotNull byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
skipBytes
public int skipBytes(int n) throws IOException- Specified by:
skipBytesin interfaceDataInput- Throws:
IOException
-
readBoolean
public boolean readBoolean() throws IOException- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
public byte readByte() throws IOException- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readUnsignedByte
public int readUnsignedByte() throws IOException- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readShort
public short readShort() throws IOException- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
public int readUnsignedShort() throws IOException- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
public char readChar() throws IOException- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
public int readInt() throws IOException- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLong
public long readLong() throws IOException- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readFloat
public float readFloat() throws IOException- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readDouble
public double readDouble() throws IOException- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readLine
public String readLine() throws IOException
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readUTF
public String readUTF() throws IOException
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
startRead
public FileInput.Crc32CheckingFileInput startRead(boolean skipCheck)
-
-