public final class PackOutputStream
extends java.io.OutputStream
PackWriter
.Constructor and Description |
---|
PackOutputStream(ProgressMonitor writeMonitor,
java.io.OutputStream out,
PackWriter pw)
Initialize a pack output stream.
|
Modifier and Type | Method and Description |
---|---|
void |
flush() |
byte[] |
getCopyBuffer() |
long |
length() |
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.
|
public PackOutputStream(ProgressMonitor writeMonitor, java.io.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 void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
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
public void writeObject(ObjectToPack otp) throws java.io.IOException
otp
- the object to write.java.io.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 void writeHeader(ObjectToPack otp, long rawLength) throws java.io.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.java.io.IOException
- the underlying stream refused to accept the header.public byte[] getCopyBuffer()
public long length()
Copyright © 2012. All Rights Reserved.