Represents anything that you can read from, much like the UNIX notion of file descriptor.

By: Stéphane Épardaud

no type hierarchy

Inherited Attributes
Attributes inherited from: Object
readSource Codeshared formal Integer read(ByteBuffer buffer)

Reads everything we can from this file descriptor into the specified buffer.

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

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

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

readFullySource Codeshared void readFully(void consume(ByteBuffer buffer), ByteBuffer buffer = ...)

Reads data until the end of file is reached, in a blocking way, by passing it to the specified consumer. This method makes no sense if the file descriptor is in non-blocking mode.

  • buffer = newBuffer()
Inherited Methods
Methods inherited from: Object
Methods inherited from: Closeable