Class AbstractFileIO
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.file.AbstractFileIO
-
- All Implemented Interfaces:
AutoCloseable,FileIO
- Direct Known Subclasses:
AsyncFileIO,FileIODecorator,RandomAccessFileIO,UnzipFileIO
public abstract class AbstractFileIO extends Object implements FileIO
-
-
Constructor Summary
Constructors Constructor Description AbstractFileIO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intreadFully(byte[] buf, int off, int len)Reads a up tolengthbytes from this file into thebuffer.intreadFully(ByteBuffer destBuf)Reads a sequence of bytes from this file into thedestinationBuffer.intreadFully(ByteBuffer destBuf, long position)Reads a sequence of bytes from this file into thedestinationBufferstarting from specified fileposition.intwriteFully(byte[] buf, int off, int len)Writeslengthbytes from thebufferstarting at offsetoffto this file.intwriteFully(ByteBuffer srcBuf)Writes a sequence of bytes to this file from thesourceBuffer.intwriteFully(ByteBuffer srcBuf, long position)Writes a sequence of bytes to this file from thesourceBufferstarting from specified fileposition-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.cache.persistence.file.FileIO
clear, close, force, force, getFileSystemBlockSize, getSparseSize, map, position, position, punchHole, read, read, read, size, transferFrom, transferTo, write, write, write
-
-
-
-
Method Detail
-
readFully
public int readFully(ByteBuffer destBuf) throws IOException
Reads a sequence of bytes from this file into thedestinationBuffer.- Specified by:
readFullyin interfaceFileIO- Parameters:
destBuf- Destination byte buffer.- Returns:
- Number of written bytes.
- Throws:
IOException- If some I/O error occurs.
-
readFully
public int readFully(ByteBuffer destBuf, long position) throws IOException
Reads a sequence of bytes from this file into thedestinationBufferstarting from specified fileposition.- Specified by:
readFullyin interfaceFileIO- Parameters:
destBuf- Destination byte buffer.position- Starting position of file.- Returns:
- Number of written bytes.
- Throws:
IOException- If some I/O error occurs.
-
readFully
public int readFully(byte[] buf, int off, int len) throws IOExceptionReads a up tolengthbytes from this file into thebuffer.- Specified by:
readFullyin interfaceFileIO- Parameters:
buf- Destination byte array.off- The start offset in arraybat which the data is written.len- Number of bytes read.- Returns:
- Number of written bytes.
- Throws:
IOException- If some I/O error occurs.
-
writeFully
public int writeFully(ByteBuffer srcBuf) throws IOException
Writes a sequence of bytes to this file from thesourceBuffer.- Specified by:
writeFullyin interfaceFileIO- Parameters:
srcBuf- Source buffer.- Returns:
- Number of written bytes.
- Throws:
IOException- If some I/O error occurs.
-
writeFully
public int writeFully(ByteBuffer srcBuf, long position) throws IOException
Writes a sequence of bytes to this file from thesourceBufferstarting from specified fileposition- Specified by:
writeFullyin interfaceFileIO- Parameters:
srcBuf- Source buffer.position- Starting file position.- Returns:
- Number of written bytes.
- Throws:
IOException- If some I/O error occurs.
-
writeFully
public int writeFully(byte[] buf, int off, int len) throws IOExceptionWriteslengthbytes from thebufferstarting at offsetoffto this file.- Specified by:
writeFullyin interfaceFileIO- Parameters:
buf- Source byte array.off- Start offset in thebuffer.len- Number of bytes to write.- Returns:
- Number of written bytes.
- Throws:
IOException- If some I/O error occurs.
-
-