Top Description Fields Constructors Methods
org.eclipse.jgit.merge

pack-priv Class EolAwareOutputStream

extends OutputStream
Class Inheritance
Imports
java.io.IOException, .OutputStream

An output stream which is aware of newlines and can be asked to begin a new line if not already in one.

Field Summary

Modifier and TypeField and Description
private boolean
private final OutputStream

Constructor Summary

AccessConstructor and Description
pack-priv
EolAwareOutputStream(OutputStream
stream to output all writes to.
out
)

Initialize a new EOL aware stream.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
beginln()

Begin a new line if not already in one.

pack-priv boolean

Returns:

true if a new line has just begun.
isBeginln
()

Whether a new line has just begun

public void
write(int
the byte.
val
)

Implements abstract java.io.OutputStream.write.

Writes the specified byte to this output stream.

public void
write(byte[]
the data.
buf
,
int
the start offset in the data.
pos
,
int
the number of bytes to write.
cnt
)

Overrides java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Inherited from java.io.OutputStream:
closeflushnullOutputStreamwrite

Field Detail

bolback to summary
private boolean bol
outback to summary
private final OutputStream out

Constructor Detail

EolAwareOutputStreamback to summary
pack-priv EolAwareOutputStream(OutputStream out)

Initialize a new EOL aware stream.

Parameters
out:OutputStream

stream to output all writes to.

Method Detail

beginlnback to summary
pack-priv void beginln() throws IOException

Begin a new line if not already in one.

Exceptions
IOException:
if an I/O error occurs.
isBeginlnback to summary
pack-priv boolean isBeginln()

Whether a new line has just begun

Returns:boolean

true if a new line has just begun.

writeback to summary
public void write(int val) throws IOException

Implements abstract java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Parameters
val:int

the byte.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.
writeback to summary
public void write(byte[] buf, int pos, int cnt) throws IOException

Overrides java.io.OutputStream.write.

Doc from java.io.OutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream. The general contract for write(b, off, len) is that some of the bytes in the array b are written to the output stream in order; element b[off] is the first byte written and b[off+len-1] is the last byte written by this operation.

If b is null, a NullPointerException is thrown.

If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown.

Parameters
buf:byte[]

the data.

pos:int

the start offset in the data.

cnt:int

the number of bytes to write.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs. In particular, an IOException is thrown if the output stream is closed.