private void read (boolean external, int address, byte buf [], int off, int len)
    throws IOException
    {
	int val;
	int card = external ? 1 : 0;

	if ((len % BLOCKSIZE) != 0)
	    throw new IllegalArgumentException ();

	if ((val = get (RIO_SET_READ_PTR, address, card)) == 0
		|| (val = get (RIO_SET_READ_LEN,
				len / IO_SIZE_BIG,
				len % IO_SIZE_BIG)) == 0)
	    throw new IOException ("rio read");
	// value of the READ command appears to be bytecount (len).
	socket.getInputStream ().read (buf, off, len);
    }