[][src]Function rust_hdfs::hadoopReadZero

pub unsafe extern "C" fn hadoopReadZero(
    file: hdfsFile,
    opts: *mut hadoopRzOptions,
    maxLength: i32
) -> *mut hadoopRzBuffer

Perform a byte buffer read. If possible, this will be a zero-copy (mmap) read.

@param file The file to read from. @param opts An options structure created by hadoopRzOptionsAlloc. @param maxLength The maximum length to read. We may read fewer bytes than this length.

@return On success, we will return a new hadoopRzBuffer. This buffer will continue to be valid and readable until it is released by readZeroBufferFree. Failure to release a buffer will lead to a memory leak. You can access the data within the hadoopRzBuffer with hadoopRzBufferGet. If you have reached EOF, the data within the hadoopRzBuffer will be NULL. You must still free hadoopRzBuffer instances containing NULL.

              On failure, we will return NULL plus an errno code.
              errno = EOPNOTSUPP indicates that we could not do a
              zero-copy read, and there was no ByteBufferPool
              supplied.