Package com.mckoi.database
Class FixedSizeDataStore.SectorOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.mckoi.database.FixedSizeDataStore.SectorOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
- Enclosing class:
- FixedSizeDataStore
private class FixedSizeDataStore.SectorOutputStream extends java.io.OutputStream
A buffered OutputStream object that writes all data written to the stream out to the store.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
buf
The sector buffers.private int
count
Total bytes written.private int
cur_sector
The cur sector to use.private int
first_sector
The first sector we wrote to.private int
index
Current index in the bufferprivate int
last_sector
The last sector we wrote to.
-
Constructor Summary
Constructors Constructor Description SectorOutputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
void
write(byte[] b, int offset, int len)
void
write(int b)
-
-
-
Field Detail
-
buf
private final byte[] buf
The sector buffers.
-
first_sector
private int first_sector
The first sector we wrote to.
-
cur_sector
private int cur_sector
The cur sector to use.
-
last_sector
private int last_sector
The last sector we wrote to.
-
index
private int index
Current index in the buffer
-
count
private int count
Total bytes written.
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException
- Specified by:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] b, int offset, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
-