Package com.google.common.jimfs
Class JimfsOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.google.common.jimfs.JimfsOutputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
final class JimfsOutputStream extends java.io.OutputStream
OutputStream
for writing to aRegularFile
.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
append
(package private) RegularFile
file
private FileSystemState
fileSystemState
private long
pos
-
Constructor Summary
Constructors Constructor Description JimfsOutputStream(RegularFile file, boolean append, FileSystemState fileSystemState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkNotClosed()
void
close()
private boolean
isOpen()
void
write(byte[] b)
void
write(byte[] b, int off, int len)
void
write(int b)
private void
writeInternal(byte[] b, int off, int len)
-
-
-
Field Detail
-
file
RegularFile file
-
pos
private long pos
-
append
private final boolean append
-
fileSystemState
private final FileSystemState fileSystemState
-
-
Constructor Detail
-
JimfsOutputStream
JimfsOutputStream(RegularFile file, boolean append, FileSystemState fileSystemState)
-
-
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) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
writeInternal
private void writeInternal(byte[] b, int off, int len) throws java.io.IOException
- Throws:
java.io.IOException
-
checkNotClosed
private void checkNotClosed() throws java.io.IOException
- 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
-
isOpen
private boolean isOpen()
-
-