public static class RefAdvertiser.PacketLineOutRefAdvertiser extends RefAdvertiser
PacketLineOut
format.RefAdvertiser.PacketLineOutRefAdvertiser
Modifier and Type | Field and Description |
---|---|
private byte[] |
binArr |
private java.nio.ByteBuffer |
binBuf |
private char[] |
chArr |
private java.nio.CharBuffer |
chBuf |
private PacketLineOut |
pckOut |
private java.nio.charset.CharsetEncoder |
utf8 |
capablities, first
Constructor and Description |
---|
PacketLineOutRefAdvertiser(PacketLineOut out)
Create a new advertiser for the supplied stream.
|
Modifier and Type | Method and Description |
---|---|
void |
advertiseId(AnyObjectId id,
java.lang.String refName)
Advertise one object under a specific name.
|
private void |
append(int b) |
private void |
append(java.lang.String str) |
protected void |
end()
Mark the end of the advertisements.
|
private void |
grow() |
protected void |
writeOne(java.lang.CharSequence line)
Write a single advertisement line.
|
addSymref, advertiseCapability, advertiseCapability, advertiseHave, init, isEmpty, send, send, setDerefTags, setUseProtocolV2
private final java.nio.charset.CharsetEncoder utf8
private final PacketLineOut pckOut
private byte[] binArr
private java.nio.ByteBuffer binBuf
private char[] chArr
private java.nio.CharBuffer chBuf
public PacketLineOutRefAdvertiser(PacketLineOut out)
out
- the output stream.public void advertiseId(AnyObjectId id, java.lang.String refName) throws java.io.IOException
RefAdvertiser
If the advertised object is a tag, this method does not advertise the peeled version of it.
advertiseId
in class RefAdvertiser
id
- the object to advertise.refName
- name of the reference to advertise the object as, can be any
string not including the NUL byte.java.io.IOException
- the underlying output stream failed to write out an
advertisement record.private void append(java.lang.String str) throws java.nio.charset.CharacterCodingException
java.nio.charset.CharacterCodingException
private void append(int b)
private void grow()
protected void writeOne(java.lang.CharSequence line) throws java.io.IOException
RefAdvertiser
writeOne
in class RefAdvertiser
line
- the advertisement line to be written. The line always ends
with LF. Never null or the empty string.java.io.IOException
- the underlying output stream failed to write out an
advertisement record.protected void end() throws java.io.IOException
RefAdvertiser
end
in class RefAdvertiser
java.io.IOException
- the underlying output stream failed to write out an
advertisement record.