Package com.mckoi.database
Class FixedSizeDataStore.SectorInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.mckoi.database.FixedSizeDataStore.SectorInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Enclosing class:
- FixedSizeDataStore
private final class FixedSizeDataStore.SectorInputStream extends java.io.InputStreamAn input stream that reads information across a sector chain starting at the given head sector.
-
-
Field Summary
Fields Modifier and Type Field Description private intcountThe number of bytes we have read.private intindexCurrent index in buf.private intsectorThe current sector we are traversing.private byte[]sector_bufferA reference to the sector buffer.
-
Constructor Summary
Constructors Constructor Description SectorInputStream(int sector_head)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidloadNextSector()Loads the next sector in the chain into sector_buffer and sets index to the start of the buffer.intread()intread(byte[] b, int offset, int len)longskip(long len)
-
-
-
Method Detail
-
loadNextSector
private void loadNextSector() throws java.io.IOExceptionLoads the next sector in the chain into sector_buffer and sets index to the start of the buffer.- Throws:
java.io.IOException
-
read
public final int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] b, int offset, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
skip
public long skip(long len) throws java.io.IOException- Overrides:
skipin classjava.io.InputStream- Throws:
java.io.IOException
-
-