public final class PackOutputStream extends OutputStream
PackWriter
.Constructor and Description |
---|
PackOutputStream(ProgressMonitor writeMonitor,
OutputStream out,
PackWriter pw)
Initialize a pack output stream.
|
Modifier and Type | Method and Description |
---|---|
void |
flush() |
byte[] |
getCopyBuffer()
Get a temporary buffer writers can use to copy data with.
|
long |
length()
Get total number of bytes written since stream start.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeHeader(ObjectToPack otp,
long rawLength)
Commits the object header onto the stream.
|
void |
writeObject(ObjectToPack otp)
Write one object.
|
close, write
public PackOutputStream(ProgressMonitor writeMonitor, OutputStream out, PackWriter pw)
This constructor is exposed to support debugging the JGit library only.
Application or storage level code should not create a PackOutputStream,
instead use PackWriter
,
and let the writer create the stream.
writeMonitor
- monitor to update on object output progress.out
- target stream to receive all object contents.pw
- packer that is going to perform the output.public final void write(int b) throws IOException
write
in class OutputStream
IOException
public final void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public final void writeObject(ObjectToPack otp) throws IOException
otp
- the object to write.IOException
- the object cannot be read from the object reader, or the
output stream is no longer accepting output. Caller must
examine the type of exception and possibly its message to
distinguish between these cases.public final void writeHeader(ObjectToPack otp, long rawLength) throws IOException
Once the header has been written, the object representation must be fully output, or packing must abort abnormally.
otp
- the object to pack. Header information is obtained.rawLength
- number of bytes of the inflated content. For an object that is
in whole object format, this is the same as the object size.
For an object that is in a delta format, this is the size of
the inflated delta instruction stream.IOException
- the underlying stream refused to accept the header.public final byte[] getCopyBuffer()
public final long length()
Copyright © 2019 Eclipse JGit Project. All rights reserved.