/** * Reads data from the native unix file descriptor. * @param dst The destination <tt>ByteBuffer</tt> to place read bytes in. * @return The number of bytes read. * * @throws java.io.IOException If an error occurred during reading. */ public int read(ByteBuffer dst) throws IOException { if (!isOpen) { throw new IOException("Not open"); } int n = libc.read(fd, dst, dst.remaining()); if (n > 0) { dst.position(dst.position() + n); } else if (n == 0) { return -1; // EOF } return n; }
public int read(int fd, byte[] buf, int n) { return libc().read(fd, buf, n); } public int write(int fd, byte[] buf, int n) {
public int read(int fd, ByteBuffer buf, int n) { return libc().read(fd, buf, n); } public int write(int fd, ByteBuffer buf, int n) {
/** * Reads data from the native unix file descriptor. * @param dst The destination <tt>ByteBuffer</tt> to place read bytes in. * @return The number of bytes read. * * @throws java.io.IOException If an error occurred during reading. */ public int read(ByteBuffer dst) throws IOException { if (!isOpen) { throw new IOException("Not open"); } int n = libc.read(fd, dst, dst.remaining()); if (n > 0) { dst.position(dst.position() + n); } else if (n == 0) { return -1; // EOF } return n; }
/** * Reads data from the native unix file descriptor. * @param dst The destination <tt>ByteBuffer</tt> to place read bytes in. * @return The number of bytes read. * * @throws java.io.IOException If an error occurred during reading. */ public int read(ByteBuffer dst) throws IOException { if (!isOpen) { throw new IOException("Not open"); } int n = libc.read(fd, dst, dst.remaining()); if (n > 0) { dst.position(dst.position() + n); } else if (n == 0) { return -1; // EOF } return n; }
/** * Reads data from the native unix file descriptor. * @param dst The destination <tt>ByteBuffer</tt> to place read bytes in. * @return The number of bytes read. * * @throws java.io.IOException If an error occurred during reading. */ public int read(ByteBuffer dst) throws IOException { if (!isOpen) { throw new IOException("Not open"); } int n = libc.read(fd, dst, dst.remaining()); if (n > 0) { dst.position(dst.position() + n); } else if (n == 0) { return -1; // EOF } return n; }
public long read(int fd, ByteBuffer buf, long n) { return libc().read(fd, buf, n); } public long write(int fd, ByteBuffer buf, long n) {
public long read(int fd, byte[] buf, long n) { return libc().read(fd, buf, n); } public long write(int fd, byte[] buf, long n) {
public int read(int fd, byte[] buf, int n) { return libc().read(fd, buf, n); }
public int read(int fd, ByteBuffer buf, int n) { return libc().read(fd, buf, n); }
public int read(int fd, byte[] buf, int n) { return libc().read(fd, buf, n); }
public int read(int fd, ByteBuffer buf, int n) { return libc().read(fd, buf, n); }