@Override
    public void open(UsbDeviceConnection connection) throws IOException {
        if (mConnection != null) {
            throw new IOException("Already open");
        }
        if(connection == null) {
            throw new IllegalArgumentException("Connection is null");
        }
        mConnection = connection;
        boolean ok = false;
        try {
            openInt();
            if (mReadEndpoint == null || mWriteEndpoint == null) {
                throw new IOException("Could not get read & write endpoints");
            }
            mUsbRequest = new UsbRequest();
            mUsbRequest.initialize(mConnection, mReadEndpoint);
            ok = true;
        } finally {
            if (!ok) {
                try {
                    close();
                } catch (Exception ignored) {}
            }
        }
    }
Sets the size of the internal buffer used to exchange data with the USB
stack for write operations.  Most users should not need to change this.

@param bufferSize the size in bytes, <= 0 resets original size
usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver/CommonUsbSerialPort.java