public class AtomicObjectOutputStream extends OutputStream
LockFile
which is committed on
close(). The stream checks if the hash of the stream content matches the id.Constructor and Description |
---|
AtomicObjectOutputStream(Path path)
Constructor for AtomicObjectOutputStream.
|
AtomicObjectOutputStream(Path path,
AnyLongObjectId id)
Constructor for AtomicObjectOutputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Aborts the stream.
|
void |
close() |
AnyLongObjectId |
getId()
Get the
id . |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
flush
public AtomicObjectOutputStream(Path path, AnyLongObjectId id) throws IOException
path
- a Path
object.id
- a AnyLongObjectId
object.IOException
public AtomicObjectOutputStream(Path path) throws IOException
path
- a Path
object.IOException
@Nullable public AnyLongObjectId getId()
id
.null
if called before closing this
stream.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
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void abort()
Copyright © 2020 Eclipse JGit Project. All rights reserved.