|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.apache.cassandra.io.util.SequentialWriter
public class SequentialWriter
Nested Class Summary | |
---|---|
protected static class |
SequentialWriter.BufferedFileWriterMark
Class to hold a mark to the position of the file |
Field Summary | |
---|---|
protected byte[] |
buffer
|
protected long |
bufferOffset
|
protected long |
current
|
protected boolean |
isDirty
|
protected java.io.RandomAccessFile |
out
|
java.io.DataOutputStream |
stream
|
protected boolean |
syncNeeded
|
protected int |
validBufferBytes
|
Constructor Summary | |
---|---|
SequentialWriter(java.io.File file,
int bufferSize,
boolean skipIOCache)
|
Method Summary | |
---|---|
void |
close()
|
byte[] |
digest()
Return the digest associated to this file or null if no digest was created. |
void |
flush()
If buffer is dirty, flush it's contents to the operating system. |
protected void |
flushData()
Override this method instead of overriding flush() |
protected void |
flushInternal()
|
long |
getFilePointer()
|
java.lang.String |
getPath()
|
long |
length()
|
FileMark |
mark()
|
static SequentialWriter |
open(java.io.File file)
|
static SequentialWriter |
open(java.io.File file,
boolean skipIOCache)
|
static SequentialWriter |
open(java.io.File file,
int bufferSize,
boolean skipIOCache)
|
protected void |
reBuffer()
|
void |
resetAndTruncate(FileMark mark)
|
protected void |
resetBuffer()
|
void |
setComputeDigest()
Turn on digest computation on this writer. |
void |
sync()
Synchronize file contents with disk. |
protected void |
syncInternal()
|
void |
truncate(long toSize)
|
void |
write(byte[] buffer)
|
void |
write(byte[] data,
int offset,
int length)
|
void |
write(int value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean isDirty
protected boolean syncNeeded
protected byte[] buffer
protected long current
protected long bufferOffset
protected int validBufferBytes
protected final java.io.RandomAccessFile out
public final java.io.DataOutputStream stream
Constructor Detail |
---|
public SequentialWriter(java.io.File file, int bufferSize, boolean skipIOCache) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public static SequentialWriter open(java.io.File file) throws java.io.IOException
java.io.IOException
public static SequentialWriter open(java.io.File file, boolean skipIOCache) throws java.io.IOException
java.io.IOException
public static SequentialWriter open(java.io.File file, int bufferSize, boolean skipIOCache) throws java.io.IOException
java.io.IOException
public void write(int value) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] buffer) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] data, int offset, int length) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void sync() throws java.io.IOException
java.io.IOException
- on any I/O error.protected void syncInternal() throws java.io.IOException
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- on any I/O error.protected void flushInternal() throws java.io.IOException
java.io.IOException
protected void flushData() throws java.io.IOException
java.io.IOException
- on any I/O error.public long getFilePointer()
public long length() throws java.io.IOException
java.io.IOException
public java.lang.String getPath()
protected void reBuffer() throws java.io.IOException
java.io.IOException
protected void resetBuffer()
public FileMark mark()
public void resetAndTruncate(FileMark mark) throws java.io.IOException
java.io.IOException
public void truncate(long toSize) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
public void setComputeDigest()
public byte[] digest()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |