- java.lang.Object
-
- de.ibapl.jnhw.posix.Unistd.JnhwPrimitiveArrayCritical
-
-
Constructor Summary
Constructors Constructor Description JnhwPrimitiveArrayCritical()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intread(int fildes, byte[] buf)POSIX: pread, read - read from a file.static intread(int fildes, byte[] buf, int off, int nbyte)POSIX: pread, read - read from a file.static intwrite(int fildes, byte[] buf)POSIX: pwrite, write - write on a file.static intwrite(int fildes, byte[] buf, int off, int nbyte)POSIX: pwrite, write - write on a file.
-
-
-
Method Detail
-
write
public static final int write(int fildes, byte[] buf) throws NativeErrorExceptionPOSIX: pwrite, write - write on a file.- Parameters:
fildes- a valid file descriptor open for writingbuf- The byte array from which all bytes are to be retrieved for writing.- Returns:
- The number of bytes written, possibly zero.
- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
read
public static final int read(int fildes, byte[] buf) throws NativeErrorExceptionPOSIX: pread, read - read from a file.- Parameters:
fildes- a valid file descriptor open for readingbuf- the byte array into which all bytes are to be transferred.- Returns:
- The number of bytes read, possibly zero.
- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
read
public static final int read(int fildes, byte[] buf, int off, int nbyte) throws NativeErrorExceptionPOSIX: pread, read - read from a file.- Parameters:
fildes- a valid file descriptor open for readingbuf- the byte array into which bytes are to be transferred.off- the start offset inbufto which the data is transferred.nbyte- the maximum number of bytes to read.- Returns:
- The number of bytes read, possibly zero.
- Throws:
NullPointerException- ifbufis null.ArrayIndexOutOfBoundsException- ifoffornByteout of bounds.NativeErrorException- if the return value of the native function indicates an error.
-
write
public static final int write(int fildes, byte[] buf, int off, int nbyte) throws NativeErrorExceptionPOSIX: pwrite, write - write on a file.- Parameters:
fildes- a valid file descriptor open for writingbuf- The byte array from which the bytes are to be retrieved for writing.off- the start offset inbuf.nbyte- the number of bytes to write.- Returns:
- The number of bytes written, possibly zero.
- Throws:
NullPointerException- ifbufis null.ArrayIndexOutOfBoundsException- ifoffornByteout of bounds.NativeErrorException- if the return value of the native function indicates an error.
-
-