Class NGOutputStream

All Implemented Interfaces:
Closeable, DataOutput, Flushable, AutoCloseable

class NGOutputStream extends DataOutputStream
Wraps an OutputStream to send writes in NailGun chunks. Because multiple NGOutputStreams wrap the same OutputStream (that is, the OutputStream obtained from the Socket connection with the client), writes are synchronized on the underlying OutputStream. If this were not the case, write interleaving could completely break the NailGun protocol.