@PublicApi public class FileOutStream extends OutputStream implements Cancelable
UnderStorageType
is SYNC_PERSIST, another stream will write the data to
the under storage system.Modifier and Type | Field and Description |
---|---|
protected boolean |
mCanceled |
protected boolean |
mClosed |
protected BufferedBlockOutStream |
mCurrentBlockOutStream |
protected long |
mFileId |
protected List<BufferedBlockOutStream> |
mPreviousBlockOutStreams |
protected TachyonStorageType |
mTachyonStorageType |
Constructor and Description |
---|
FileOutStream(long fileId,
OutStreamOptions options)
Creates a new file output stream.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the write to Tachyon storage.
|
void |
close() |
void |
flush() |
protected void |
handleCacheWriteException(IOException ioe) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
protected final TachyonStorageType mTachyonStorageType
protected boolean mCanceled
protected boolean mClosed
protected BufferedBlockOutStream mCurrentBlockOutStream
protected List<BufferedBlockOutStream> mPreviousBlockOutStreams
protected final long mFileId
public FileOutStream(long fileId, OutStreamOptions options) throws IOException
fileId
- the file idoptions
- the client optionsIOException
- if an I/O error occurspublic void cancel() throws IOException
Cancelable
cancel
in interface Cancelable
IOException
- if there is a failure when the worker invalidates the cache attemptpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
protected void handleCacheWriteException(IOException ioe) throws IOException
IOException
Copyright © 2015. All Rights Reserved.