Represents anything that you can write to, much like the UNIX notion of file descriptor.

By: Stéphane Épardaud

no type hierarchy

Inherited Attributes
Attributes inherited from: Object
Methods
writeSource Codeshared formal Integer write(ByteBuffer buffer)

Writes everything we can from the specified buffer to this file descriptor.

If this file descriptor is in blocking mode, it will block the current thread until the buffer is written entirely, or until we reached end of file.

If this file descriptor is in non-blocking mode, it will only write the data that can be written without blocking, which may be less than the buffer's available data.

In both cases, it returns the number of bytes written, or -1 when the end of file is reached.

writeFromSource Codeshared void writeFrom(void producer(ByteBuffer buffer), ByteBuffer buffer = ...)

Writes all the data produced by the given producer to this file descriptor, until the producer stops filling the buffer, or end of file. This method will repeatedly invoke the producer so that it can push data to the buffer. If the producer wants to indicate end of input, it only has to stop adding data to the buffer. This method makes no sense in non-blocking mode.

Parameters:
  • buffer = newBuffer()
writeFullySource Codeshared void writeFully(ByteBuffer buffer)

Writes the given buffer to this file descriptor entirely, until either the buffer has been entirely written, or until end of file. This method makes no sense if the file descriptor is in non-blocking mode.

Inherited Methods
Methods inherited from: Object
Methods inherited from: Closeable