Whitespace cleanup only

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5097 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/java/com/tigervnc/network/FileDescriptor.java b/java/com/tigervnc/network/FileDescriptor.java
index 30b4e49..8a4f693 100644
--- a/java/com/tigervnc/network/FileDescriptor.java
+++ b/java/com/tigervnc/network/FileDescriptor.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -21,7 +21,7 @@
 import com.tigervnc.rdr.Exception;
 
 public interface FileDescriptor {
-    
+
   public int read(byte[] buf, int bufPtr, int length) throws Exception;
   public int write(byte[] buf, int bufPtr, int length) throws Exception;
   public int select(int interestOps, Integer timeout) throws Exception;
diff --git a/java/com/tigervnc/network/SSLEngineManager.java b/java/com/tigervnc/network/SSLEngineManager.java
index caf89ac..654e602 100644
--- a/java/com/tigervnc/network/SSLEngineManager.java
+++ b/java/com/tigervnc/network/SSLEngineManager.java
@@ -45,7 +45,7 @@
   private FdInStream inStream;
   private FdOutStream outStream;
 
-  public SSLEngineManager(SSLEngine sslEngine, FdInStream is, 
+  public SSLEngineManager(SSLEngine sslEngine, FdInStream is,
                           FdOutStream os) throws IOException {
 
     inStream = is;
diff --git a/java/com/tigervnc/network/Socket.java b/java/com/tigervnc/network/Socket.java
index 0fadad4..bcc920d 100644
--- a/java/com/tigervnc/network/Socket.java
+++ b/java/com/tigervnc/network/Socket.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -51,7 +51,7 @@
 
   // information about the remote end of the socket
   abstract public String getPeerAddress(); // a string e.g. "192.168.0.1"
-  abstract public String getPeerName(); 
+  abstract public String getPeerName();
   abstract public int getPeerPort();
   abstract public String getPeerEndpoint(); // <address>::<port>
 
@@ -85,7 +85,7 @@
 };
 
 abstract class SocketListener {
-  public SocketListener() { 
+  public SocketListener() {
     fd = null; filter = null;
   }
 
diff --git a/java/com/tigervnc/network/SocketDescriptor.java b/java/com/tigervnc/network/SocketDescriptor.java
index 22f0a3d..3cbe5ab 100644
--- a/java/com/tigervnc/network/SocketDescriptor.java
+++ b/java/com/tigervnc/network/SocketDescriptor.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -144,7 +144,7 @@
     return n;
   }
 
-  public long write(ByteBuffer[] buf, int offset, int length) 
+  public long write(ByteBuffer[] buf, int offset, int length)
         throws IOException
   {
     long n = 0;
@@ -166,7 +166,7 @@
     return n;
   }
 
-  public long read(ByteBuffer[] buf, int offset, int length) 
+  public long read(ByteBuffer[] buf, int offset, int length)
         throws IOException
   {
     long n = 0;
@@ -181,7 +181,7 @@
   public java.net.Socket socket() {
     return channel.socket();
   }
- 
+
   public SocketAddress getRemoteAddress() throws IOException {
     if (isConnected())
       return channel.socket().getRemoteSocketAddress();
@@ -241,7 +241,7 @@
       System.out.println(e.toString());
     }
   }
-  
+
   protected SocketChannel channel;
   protected Selector writeSelector;
   protected Selector readSelector;
diff --git a/java/com/tigervnc/network/SocketException.java b/java/com/tigervnc/network/SocketException.java
index 834c1b5..aa35c7e 100644
--- a/java/com/tigervnc/network/SocketException.java
+++ b/java/com/tigervnc/network/SocketException.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/network/SocketListener.java b/java/com/tigervnc/network/SocketListener.java
index 46f2ada..a1b2c12 100644
--- a/java/com/tigervnc/network/SocketListener.java
+++ b/java/com/tigervnc/network/SocketListener.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/network/TcpListener.java b/java/com/tigervnc/network/TcpListener.java
index e658869..bab9e4c 100644
--- a/java/com/tigervnc/network/TcpListener.java
+++ b/java/com/tigervnc/network/TcpListener.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -52,7 +52,7 @@
 
     // - Bind it to the desired port
     InetAddress addr = null;
-  
+
     try {
       if (localhostOnly) {
         addr = InetAddress.getByName(null);
@@ -64,13 +64,13 @@
     } catch (UnknownHostException e) {
       throw new Exception(e.getMessage());
     }
-  
+
     try {
       channel.socket().bind(new InetSocketAddress(addr, port));
     } catch (IOException e) {
       throw new Exception("unable to bind listening socket: "+e.toString());
     }
-  
+
     // - Set it to be a listening socket
     try {
       selector = Selector.open();
diff --git a/java/com/tigervnc/network/TcpSocket.java b/java/com/tigervnc/network/TcpSocket.java
index bd5fe2b..051a9d8 100644
--- a/java/com/tigervnc/network/TcpSocket.java
+++ b/java/com/tigervnc/network/TcpSocket.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -61,7 +61,7 @@
 
     // - Create a socket
     initSockets();
-    
+
     try {
       addr = java.net.InetAddress.getByName(host);
     } catch(UnknownHostException e) {
@@ -160,11 +160,11 @@
       throw new Exception(e.getMessage());
     }
   }
-  
+
   public void close() throws IOException {
     ((SocketDescriptor)getFd()).close();
   }
-  
+
   public static boolean enableNagles(SocketDescriptor sock, boolean enable) {
     try {
       sock.channel.socket().setTcpNoDelay(!enable);
diff --git a/java/com/tigervnc/rdr/EndOfStream.java b/java/com/tigervnc/rdr/EndOfStream.java
index 516a6ba..aef2144 100644
--- a/java/com/tigervnc/rdr/EndOfStream.java
+++ b/java/com/tigervnc/rdr/EndOfStream.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rdr/Exception.java b/java/com/tigervnc/rdr/Exception.java
index 19977aa..7fd75f8 100644
--- a/java/com/tigervnc/rdr/Exception.java
+++ b/java/com/tigervnc/rdr/Exception.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rdr/FdInStream.java b/java/com/tigervnc/rdr/FdInStream.java
index 8b61592..f4e5900 100644
--- a/java/com/tigervnc/rdr/FdInStream.java
+++ b/java/com/tigervnc/rdr/FdInStream.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -31,7 +31,7 @@
   static final int minBulkSize = 1024;
 
   public FdInStream(FileDescriptor fd_, int timeoutms_, int bufSize_,
-                    boolean closeWhenDone_) 
+                    boolean closeWhenDone_)
   {
     fd = fd_; closeWhenDone = closeWhenDone_;
     timeoutms = timeoutms_; blockCallback = null;
@@ -43,7 +43,7 @@
 
   public FdInStream(FileDescriptor fd_) { this(fd_, -1, 0, false); }
 
-  public FdInStream(FileDescriptor fd_, FdInStreamBlockCallback blockCallback_, 
+  public FdInStream(FileDescriptor fd_, FdInStreamBlockCallback blockCallback_,
                     int bufSize_)
   {
     fd = fd_; timeoutms = 0; blockCallback = blockCallback_;
@@ -53,7 +53,7 @@
     ptr = end = offset = 0;
   }
 
-  public FdInStream(FileDescriptor fd_, 
+  public FdInStream(FileDescriptor fd_,
                     FdInStreamBlockCallback blockCallback_) {
     this(fd_, blockCallback_, 0);
   }
@@ -104,7 +104,7 @@
   }
 
   public final void stopTiming() {
-    timing = false; 
+    timing = false;
     if (timeWaitedIn100us < timedKbits/2)
       timeWaitedIn100us = timedKbits/2; // upper limit 20Mbit/s
   }
@@ -115,7 +115,7 @@
 
   public final long timeWaited() { return timeWaitedIn100us; }
 
-  protected int overrun(int itemSize, int nItems, boolean wait) 
+  protected int overrun(int itemSize, int nItems, boolean wait)
   {
     if (itemSize > bufSize)
       throw new Exception("FdInStream overrun: max itemSize exceeded");
@@ -159,7 +159,7 @@
     while (true) {
       do {
         Integer tv;
-    
+
         if (!wait) {
           tv = new Integer(0);
         } else if (timeoutms != -1) {
@@ -174,12 +174,12 @@
           throw new SystemException("select:"+e.toString());
         }
       } while (n < 0);
-        
-          
+
+
       if (n > 0) break;
       if (!wait) return 0;
       if (blockCallback == null) throw new TimedOut();
-    
+
       blockCallback.blockCallback();
     }
 
@@ -211,7 +211,7 @@
     return n;
   }
 
-  private int readWithTimeoutOrCallback(byte[] buf, int bufPtr, int len) { 
+  private int readWithTimeoutOrCallback(byte[] buf, int bufPtr, int len) {
     return readWithTimeoutOrCallback(buf, bufPtr, len, true);
   }
 
diff --git a/java/com/tigervnc/rdr/FdInStreamBlockCallback.java b/java/com/tigervnc/rdr/FdInStreamBlockCallback.java
index 74debfd..b597e7c 100644
--- a/java/com/tigervnc/rdr/FdInStreamBlockCallback.java
+++ b/java/com/tigervnc/rdr/FdInStreamBlockCallback.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2011-2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rdr/FdOutStream.java b/java/com/tigervnc/rdr/FdOutStream.java
index 56b660f..27db142 100644
--- a/java/com/tigervnc/rdr/FdOutStream.java
+++ b/java/com/tigervnc/rdr/FdOutStream.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2011 Pierre Ossman for Cendio AB
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -48,12 +48,12 @@
     blocking = blocking_;
   }
 
-  public int length() 
-  { 
-    return offset + ptr - sentUpTo; 
+  public int length()
+  {
+    return offset + ptr - sentUpTo;
   }
 
-  public void flush() 
+  public void flush()
   {
     int timeoutms_;
 
@@ -95,7 +95,7 @@
     int n;
 
     do {
-    
+
       Integer tv;
       if (timeoutms != -1) {
         tv = new Integer(timeoutms);
@@ -109,7 +109,7 @@
         System.out.println(e.toString());
         throw new Exception(e.getMessage());
       }
-          
+
     } while (n < 0);
 
     if (n == 0) return 0;
@@ -119,11 +119,11 @@
     } catch (java.lang.Exception e) {
       throw new Exception(e.getMessage());
     }
-    
+
     return n;
   }
 
-  protected int overrun(int itemSize, int nItems) 
+  protected int overrun(int itemSize, int nItems)
   {
     if (itemSize > bufSize)
       throw new Exception("FdOutStream overrun: max itemSize exceeded");
diff --git a/java/com/tigervnc/rdr/InStream.java b/java/com/tigervnc/rdr/InStream.java
index 3f91671..3938a32 100644
--- a/java/com/tigervnc/rdr/InStream.java
+++ b/java/com/tigervnc/rdr/InStream.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -160,7 +160,7 @@
     }
     return result;
   }
-  
+
   // pos() returns the position in the stream.
 
   abstract public int pos();
diff --git a/java/com/tigervnc/rdr/MemInStream.java b/java/com/tigervnc/rdr/MemInStream.java
index e2ce06c..c6d92a1 100644
--- a/java/com/tigervnc/rdr/MemInStream.java
+++ b/java/com/tigervnc/rdr/MemInStream.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -22,7 +22,7 @@
 
   public MemInStream(byte[] data, int offset, int len) {
     b = data;
-    start = offset;    
+    start = offset;
     ptr = start;
     end = start + len;
   }
diff --git a/java/com/tigervnc/rdr/MemOutStream.java b/java/com/tigervnc/rdr/MemOutStream.java
index 7b81083..6e53ccf 100644
--- a/java/com/tigervnc/rdr/MemOutStream.java
+++ b/java/com/tigervnc/rdr/MemOutStream.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rdr/OutStream.java b/java/com/tigervnc/rdr/OutStream.java
index 1105b1e..46fe734 100644
--- a/java/com/tigervnc/rdr/OutStream.java
+++ b/java/com/tigervnc/rdr/OutStream.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rdr/SystemException.java b/java/com/tigervnc/rdr/SystemException.java
index 6b54a8b..7537b65 100644
--- a/java/com/tigervnc/rdr/SystemException.java
+++ b/java/com/tigervnc/rdr/SystemException.java
@@ -2,17 +2,17 @@
  * Copyright (C) 2004 Red Hat Inc.
  * Copyright (C) 2010 TigerVNC Team
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rdr/TLSException.java b/java/com/tigervnc/rdr/TLSException.java
index 8999348..a25224b 100644
--- a/java/com/tigervnc/rdr/TLSException.java
+++ b/java/com/tigervnc/rdr/TLSException.java
@@ -2,17 +2,17 @@
  * Copyright (C) 2004 Red Hat Inc.
  * Copyright (C) 2010 TigerVNC Team
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rdr/TLSInStream.java b/java/com/tigervnc/rdr/TLSInStream.java
index cf7b5a4..0cdc4d9 100644
--- a/java/com/tigervnc/rdr/TLSInStream.java
+++ b/java/com/tigervnc/rdr/TLSInStream.java
@@ -2,17 +2,17 @@
  * Copyright (C) 2005 Martin Koegler
  * Copyright (C) 2010 TigerVNC Team
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -33,7 +33,7 @@
 
   public TLSInStream(InStream _in, SSLEngineManager _manager) {
     in = (FdInStream)_in;
-    manager = _manager; 
+    manager = _manager;
     offset = 0;
     SSLSession session = manager.getSession();
     bufSize = session.getApplicationBufferSize();
@@ -41,23 +41,23 @@
     ptr = end = start = 0;
   }
 
-  public final int pos() { 
+  public final int pos() {
     return offset + ptr - start;
   }
 
   public final void startTiming() {
-    in.startTiming();  
+    in.startTiming();
   }
 
   public final void stopTiming() {
-    in.stopTiming();  
+    in.stopTiming();
   }
 
   public final long kbitsPerSecond() {
     return in.kbitsPerSecond();
   }
 
-  public final long timeWaited() { 
+  public final long timeWaited() {
     return in.timeWaited();
   }
 
@@ -74,7 +74,7 @@
 
     while (end < start + itemSize) {
       int n = readTLS(b, end, start + bufSize - end, wait);
-      if (!wait && n == 0) 
+      if (!wait && n == 0)
         return 0;
       end += n;
     }
@@ -85,7 +85,7 @@
     return nItems;
   }
 
-  protected int readTLS(byte[] buf, int bufPtr, int len, boolean wait) 
+  protected int readTLS(byte[] buf, int bufPtr, int len, boolean wait)
   {
     int n = -1;
 
@@ -103,7 +103,7 @@
 
     return n;
   }
-    
+
   private SSLEngineManager manager;
   private int offset;
   private int start;
diff --git a/java/com/tigervnc/rdr/TLSOutStream.java b/java/com/tigervnc/rdr/TLSOutStream.java
index 6129652..80514b2 100644
--- a/java/com/tigervnc/rdr/TLSOutStream.java
+++ b/java/com/tigervnc/rdr/TLSOutStream.java
@@ -2,17 +2,17 @@
  * Copyright (C) 2005 Martin Koegler
  * Copyright (C) 2010 TigerVNC Team
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -41,12 +41,12 @@
     end = start + bufSize;
   }
 
-  public int length() 
-  { 
-    return offset + ptr - start; 
+  public int length()
+  {
+    return offset + ptr - start;
   }
 
-  public void flush() 
+  public void flush()
   {
     int sentUpTo = start;
     while (sentUpTo < ptr) {
@@ -59,7 +59,7 @@
     //out.flush();
   }
 
-  protected int overrun(int itemSize, int nItems) 
+  protected int overrun(int itemSize, int nItems)
   {
     if (itemSize > bufSize)
       throw new Exception("TLSOutStream overrun: max itemSize exceeded");
@@ -86,7 +86,7 @@
 
     //if (n < 0)
     //  throw new TLSException("writeTLS", n);
-  
+
     return n;
   }
 
diff --git a/java/com/tigervnc/rdr/ZlibInStream.java b/java/com/tigervnc/rdr/ZlibInStream.java
index cb28fa6..103bb64 100644
--- a/java/com/tigervnc/rdr/ZlibInStream.java
+++ b/java/com/tigervnc/rdr/ZlibInStream.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -28,7 +28,7 @@
 
   static final int defaultBufSize = 16384;
 
-  public ZlibInStream(int bufSize_) 
+  public ZlibInStream(int bufSize_)
   {
     bufSize = bufSize_;
     b = new byte[bufSize];
@@ -62,12 +62,12 @@
     ptr = end = start;
   }
 
-  public int pos() 
+  public int pos()
   {
     return offset + ptr - start;
   }
 
-  public void reset() 
+  public void reset()
   {
     ptr = end = start;
     if (underlying == null) return;
@@ -79,7 +79,7 @@
     underlying = null;
   }
 
-  protected int overrun(int itemSize, int nItems, boolean wait) 
+  protected int overrun(int itemSize, int nItems, boolean wait)
   {
     if (itemSize > bufSize)
       throw new Exception("ZlibInStream overrun: max itemSize exceeded");
@@ -109,7 +109,7 @@
   // data.  Returns false if wait is false and we would block on the underlying
   // stream.
 
-  private boolean decompress(boolean wait) 
+  private boolean decompress(boolean wait)
   {
     zs.next_out = b;
     zs.next_out_index = end;
@@ -123,7 +123,7 @@
     if (zs.avail_in > bytesIn)
       zs.avail_in = bytesIn;
 
-    int rc = zs.inflate(JZlib.Z_SYNC_FLUSH);   
+    int rc = zs.inflate(JZlib.Z_SYNC_FLUSH);
     if (rc != JZlib.Z_OK) {
       throw new Exception("ZlibInStream: inflate failed");
     }
diff --git a/java/com/tigervnc/rfb/AliasParameter.java b/java/com/tigervnc/rfb/AliasParameter.java
index 120497c..a1ae838 100644
--- a/java/com/tigervnc/rfb/AliasParameter.java
+++ b/java/com/tigervnc/rfb/AliasParameter.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2004-2005 Cendio AB.
  * Copyright 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -21,7 +21,7 @@
 package com.tigervnc.rfb;
 
 public class AliasParameter extends VoidParameter {
-  public AliasParameter(String name_, String desc_, VoidParameter param_, 
+  public AliasParameter(String name_, String desc_, VoidParameter param_,
                         Configuration.ConfigurationObject co)
   {
     super(name_, desc_, co);
diff --git a/java/com/tigervnc/rfb/AuthFailureException.java b/java/com/tigervnc/rfb/AuthFailureException.java
index b2e5405..542270c 100644
--- a/java/com/tigervnc/rfb/AuthFailureException.java
+++ b/java/com/tigervnc/rfb/AuthFailureException.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/BoolParameter.java b/java/com/tigervnc/rfb/BoolParameter.java
index 0806be4..fc31d7a 100644
--- a/java/com/tigervnc/rfb/BoolParameter.java
+++ b/java/com/tigervnc/rfb/BoolParameter.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2004-2005 Cendio AB.
  * Copyright 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -50,7 +50,7 @@
   }
 
   public boolean setParam() { setParam(true); return true; }
-  public void setParam(boolean b) { 
+  public void setParam(boolean b) {
     if (immutable) return;
     value = b;
   }
diff --git a/java/com/tigervnc/rfb/CConnection.java b/java/com/tigervnc/rfb/CConnection.java
index a923028..c354868 100644
--- a/java/com/tigervnc/rfb/CConnection.java
+++ b/java/com/tigervnc/rfb/CConnection.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011-2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -26,9 +26,9 @@
 
 abstract public class CConnection extends CMsgHandler {
 
-  public CConnection() 
+  public CConnection()
   {
-    csecurity = null; is = null; os = null; reader_ = null; 
+    csecurity = null; is = null; os = null; reader_ = null;
     writer_ = null; shared = false;
     state_ = RFBSTATE_UNINITIALISED; useProtocol3_3 = false;
     security = new SecurityClient();
@@ -48,14 +48,14 @@
   // initialiseProtocol() should be called once the streams and security
   // types are set.  Subsequently, processMsg() should be called whenever
   // there is data to read on the InStream.
-  public final void initialiseProtocol() 
+  public final void initialiseProtocol()
   {
     state_ = RFBSTATE_PROTOCOL_VERSION;
   }
 
   // processMsg() should be called whenever there is data to read on the
   // InStream.  You must have called initialiseProtocol() first.
-  public void processMsg() 
+  public void processMsg()
   {
     switch (state_) {
 
@@ -72,7 +72,7 @@
     }
   }
 
-  private void processVersionMsg() 
+  private void processVersionMsg()
   {
     vlog.debug("reading protocol version");
     if (!cp.readVersion(is)) {
@@ -104,7 +104,7 @@
               cp.majorVersion+"."+cp.minorVersion);
   }
 
-  private void processSecurityTypesMsg() 
+  private void processSecurityTypesMsg()
   {
     vlog.debug("processing security types message");
 
@@ -130,7 +130,7 @@
             break;
           }
         }
-      
+
         if (!secTypes.contains(secType))
           secType = Security.secTypeInvalid;
       } else {
@@ -264,7 +264,7 @@
   // streams over which the RFB protocol is sent (i.e. encrypting/decrypting
   // streams).  Ownership of the streams remains with the caller
   // (i.e. SConnection will not delete them).
-  public final void setStreams(InStream is_, OutStream os_) 
+  public final void setStreams(InStream is_, OutStream os_)
   {
     is = is_;
     os = os_;
@@ -281,7 +281,7 @@
   public void setServerPort(int port) {
     serverPort = port;
   }
- 
+
   public void initSecTypes() {
     nSecTypes = 0;
   }
@@ -312,7 +312,7 @@
   // getCurrentCSecurity() gets the CSecurity instance used for this
   // connection.
   //public CSecurity getCurrentCSecurity() { return security; }
-  
+
   // setClientSecTypeOrder() determines whether the client should obey the
   // server's security type preference, by picking the first server security
   // type that the client supports, or whether it should pick the first type
@@ -344,7 +344,7 @@
   public int state() { return state_; }
 
   protected final void setState(int s) { state_ = s; }
-  
+
   public void fence(int flags, int len, byte[] data)
   {
     super.fence(flags, len, data);
diff --git a/java/com/tigervnc/rfb/CMsgHandler.java b/java/com/tigervnc/rfb/CMsgHandler.java
index 653ee70..dd9767e 100644
--- a/java/com/tigervnc/rfb/CMsgHandler.java
+++ b/java/com/tigervnc/rfb/CMsgHandler.java
@@ -2,17 +2,17 @@
  * Copyright 2009-2011 Pierre Ossman for Cendio AB
  * Copyright (C) 2011 D. R. Commander.  All Rights Reserved.
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -31,7 +31,7 @@
     cp = new ConnParams();
   }
 
-  public void setDesktopSize(int width, int height) 
+  public void setDesktopSize(int width, int height)
   {
     cp.width = width;
     cp.height = height;
@@ -39,10 +39,10 @@
 
   public void setExtendedDesktopSize(int reason, int result,
                                      int width, int height,
-                                     ScreenSet layout) 
+                                     ScreenSet layout)
   {
     cp.supportsSetDesktopSize = true;
-    
+
     if ((reason == screenTypes.reasonClient) && (result != screenTypes.resultSuccess))
       return;
 
@@ -54,27 +54,27 @@
     cp.screenLayout = layout;
   }
 
-  public void setPixelFormat(PixelFormat pf) 
+  public void setPixelFormat(PixelFormat pf)
   {
     cp.setPF(pf);
   }
 
-  public void setName(String name) 
+  public void setName(String name)
   {
     cp.setName(name);
   }
 
-  public void fence(int flags, int len, byte[] data) 
+  public void fence(int flags, int len, byte[] data)
   {
     cp.supportsFence = true;
   }
 
-  public void endOfContinuousUpdates() 
+  public void endOfContinuousUpdates()
   {
     cp.supportsContinuousUpdates = true;
   }
 
-  public void clientRedirect(int port, String host, 
+  public void clientRedirect(int port, String host,
                              String x509subject) {}
 
   public void setCursor(int width, int height, Point hotspot,
@@ -86,7 +86,7 @@
   public void beginRect(Rect r, int encoding) {}
   public void endRect(Rect r, int encoding) {}
 
-  public void setColourMapEntries(int firstColour, int nColours, 
+  public void setColourMapEntries(int firstColour, int nColours,
     int[] rgbs) { }
   public void bell() {}
   public void serverCutText(String str, int len) {}
diff --git a/java/com/tigervnc/rfb/CMsgReader.java b/java/com/tigervnc/rfb/CMsgReader.java
index e47d5d6..71045f3 100644
--- a/java/com/tigervnc/rfb/CMsgReader.java
+++ b/java/com/tigervnc/rfb/CMsgReader.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -27,7 +27,7 @@
 
 abstract public class CMsgReader {
 
-  protected CMsgReader(CMsgHandler handler_, InStream is_) 
+  protected CMsgReader(CMsgHandler handler_, InStream is_)
   {
     imageBufIdealSize = 0;
     handler = handler_;
@@ -37,7 +37,7 @@
     decoders = new Decoder[Encodings.encodingMax+1];
   }
 
-  protected void readSetColourMapEntries() 
+  protected void readSetColourMapEntries()
   {
     is.skip(1);
     int firstColour = is.readU16();
@@ -48,12 +48,12 @@
     handler.setColourMapEntries(firstColour, nColours, rgbs);
   }
 
-  protected void readBell() 
+  protected void readBell()
   {
     handler.bell();
   }
 
-  protected void readServerCutText() 
+  protected void readServerCutText()
   {
     is.skip(3);
     int len = is.readU32();
@@ -73,17 +73,17 @@
     handler.serverCutText(str, len);
   }
 
-  protected void readFramebufferUpdateStart() 
+  protected void readFramebufferUpdateStart()
   {
     handler.framebufferUpdateStart();
   }
 
-  protected void readFramebufferUpdateEnd() 
+  protected void readFramebufferUpdateEnd()
   {
     handler.framebufferUpdateEnd();
   }
 
-  protected void readRect(Rect r, int encoding) 
+  protected void readRect(Rect r, int encoding)
   {
     if ((r.br.x > handler.cp.width) || (r.br.y > handler.cp.height)) {
       vlog.error("Rect too big: "+r.width()+"x"+r.height()+" at "+
@@ -114,14 +114,14 @@
     handler.endRect(r, encoding);
   }
 
-  protected void readCopyRect(Rect r) 
+  protected void readCopyRect(Rect r)
   {
     int srcX = is.readU16();
     int srcY = is.readU16();
     handler.copyRect(r, srcX, srcY);
   }
 
-  protected void readSetCursor(int width, int height, Point hotspot) 
+  protected void readSetCursor(int width, int height, Point hotspot)
   {
     int data_len = width * height;
     int mask_len = ((width+7)/8) * height;
@@ -134,9 +134,9 @@
     handler.setCursor(width, height, hotspot, data, mask);
   }
 
-  public int[] getImageBuf(int required) { return getImageBuf(required, 0, 0); } 
+  public int[] getImageBuf(int required) { return getImageBuf(required, 0, 0); }
 
-  public int[] getImageBuf(int required, int requested, int nPixels) 
+  public int[] getImageBuf(int required, int requested, int nPixels)
   {
     int requiredBytes = required;
     int requestedBytes = requested;
@@ -155,9 +155,9 @@
     return imageBuf;
   }
 
-  public final int bpp() 
+  public final int bpp()
   {
-    return handler.cp.pf().bpp; 
+    return handler.cp.pf().bpp;
   }
 
   abstract public void readServerInit();
diff --git a/java/com/tigervnc/rfb/CMsgReaderV3.java b/java/com/tigervnc/rfb/CMsgReaderV3.java
index f59d237..e09d3bb 100644
--- a/java/com/tigervnc/rfb/CMsgReaderV3.java
+++ b/java/com/tigervnc/rfb/CMsgReaderV3.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2009-2011 Pierre Ossman for Cendio AB
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -24,13 +24,13 @@
 
 public class CMsgReaderV3 extends CMsgReader {
 
-  public CMsgReaderV3(CMsgHandler handler_, InStream is_) 
+  public CMsgReaderV3(CMsgHandler handler_, InStream is_)
   {
     super(handler_, is_);
     nUpdateRectsLeft = 0;
   }
 
-  public void readServerInit() 
+  public void readServerInit()
   {
     int width = is.readU16();
     int height = is.readU16();
@@ -43,7 +43,7 @@
     handler.serverInit();
   }
 
-  public void readMsg() 
+  public void readMsg()
   {
     if (nUpdateRectsLeft == 0) {
 
@@ -97,7 +97,7 @@
     }
   }
 
-  void readFramebufferUpdate() 
+  void readFramebufferUpdate()
   {
     is.skip(1);
     nUpdateRectsLeft = is.readU16();
@@ -107,25 +107,25 @@
   void readSetDesktopName(int x, int y, int w, int h)
   {
     String name = is.readString();
-  
+
     if (x != 0 || y != 0 || w != 0 || h != 0) {
       vlog.error("Ignoring DesktopName rect with non-zero position/size");
     } else {
       handler.setName(name);
     }
-  
+
   }
-  
+
   void readExtendedDesktopSize(int x, int y, int w, int h)
   {
     int screens, i;
     int id, flags;
     int sx, sy, sw, sh;
     ScreenSet layout = new ScreenSet();
-  
+
     screens = is.readU8();
     is.skip(3);
-  
+
     for (i = 0;i < screens;i++) {
       id = is.readU32();
       sx = is.readU16();
@@ -133,10 +133,10 @@
       sw = is.readU16();
       sh = is.readU16();
       flags = is.readU32();
-  
+
       layout.add_screen(new Screen(id, sx, sy, sw, sh, flags));
     }
-  
+
     handler.setExtendedDesktopSize(x, y, w, h, layout);
   }
 
@@ -145,29 +145,29 @@
     int flags;
     int len;
     byte[] data = new byte[64];
-  
+
     is.skip(3);
-  
+
     flags = is.readU32();
-  
+
     len = is.readU8();
     if (len > data.length) {
       System.out.println("Ignoring fence with too large payload\n");
       is.skip(len);
       return;
     }
-  
+
     is.readBytes(data, 0, len);
-    
+
     handler.fence(flags, len, data);
   }
-  
+
   void readEndOfContinuousUpdates()
   {
     handler.endOfContinuousUpdates();
   }
 
-  void readClientRedirect(int x, int y, int w, int h) 
+  void readClientRedirect(int x, int y, int w, int h)
   {
     int port = is.readU16();
     String host = is.readString();
diff --git a/java/com/tigervnc/rfb/CMsgWriter.java b/java/com/tigervnc/rfb/CMsgWriter.java
index 3066531..3b226b1 100644
--- a/java/com/tigervnc/rfb/CMsgWriter.java
+++ b/java/com/tigervnc/rfb/CMsgWriter.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2009-2011 Pierre Ossman for Cendio AB
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -26,15 +26,15 @@
 
   abstract public void writeClientInit(boolean shared);
 
-  synchronized public void writeSetPixelFormat(PixelFormat pf) 
+  synchronized public void writeSetPixelFormat(PixelFormat pf)
   {
-    startMsg(MsgTypes.msgTypeSetPixelFormat);                                 
+    startMsg(MsgTypes.msgTypeSetPixelFormat);
     os.pad(3);
     pf.write(os);
     endMsg();
   }
 
-  synchronized public void writeSetEncodings(int nEncodings, int[] encodings) 
+  synchronized public void writeSetEncodings(int nEncodings, int[] encodings)
   {
     startMsg(MsgTypes.msgTypeSetEncodings);
     os.skip(1);
@@ -47,7 +47,7 @@
   // Ask for encodings based on which decoders are supported.  Assumes higher
   // encoding numbers are more desirable.
 
-  synchronized public void writeSetEncodings(int preferredEncoding, boolean useCopyRect) 
+  synchronized public void writeSetEncodings(int preferredEncoding, boolean useCopyRect)
   {
     int nEncodings = 0;
     int[] encodings = new int[Encodings.encodingMax+3];
@@ -65,7 +65,7 @@
     encodings[nEncodings++] = Encodings.pseudoEncodingLastRect;
     encodings[nEncodings++] = Encodings.pseudoEncodingContinuousUpdates;
     encodings[nEncodings++] = Encodings.pseudoEncodingFence;
-    
+
 
     if (Decoder.supported(preferredEncoding)) {
       encodings[nEncodings++] = preferredEncoding;
@@ -115,7 +115,7 @@
     writeSetEncodings(nEncodings, encodings);
   }
 
-  synchronized public void writeFramebufferUpdateRequest(Rect r, boolean incremental) 
+  synchronized public void writeFramebufferUpdateRequest(Rect r, boolean incremental)
   {
     startMsg(MsgTypes.msgTypeFramebufferUpdateRequest);
     os.writeU8(incremental?1:0);
@@ -126,7 +126,7 @@
     endMsg();
   }
 
-  synchronized public void writeKeyEvent(int key, boolean down) 
+  synchronized public void writeKeyEvent(int key, boolean down)
   {
     startMsg(MsgTypes.msgTypeKeyEvent);
     os.writeU8(down?1:0);
@@ -135,7 +135,7 @@
     endMsg();
   }
 
-  synchronized public void writePointerEvent(Point pos, int buttonMask) 
+  synchronized public void writePointerEvent(Point pos, int buttonMask)
   {
     Point p = new Point(pos.x,pos.y);
     if (p.x < 0) p.x = 0;
@@ -150,7 +150,7 @@
     endMsg();
   }
 
-  synchronized public void writeClientCutText(String str, int len) 
+  synchronized public void writeClientCutText(String str, int len)
   {
     startMsg(MsgTypes.msgTypeClientCutText);
     os.pad(3);
diff --git a/java/com/tigervnc/rfb/CMsgWriterV3.java b/java/com/tigervnc/rfb/CMsgWriterV3.java
index a730698..10c377a 100644
--- a/java/com/tigervnc/rfb/CMsgWriterV3.java
+++ b/java/com/tigervnc/rfb/CMsgWriterV3.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2009-2011 Pierre Ossman for Cendio AB
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -45,16 +45,16 @@
 	{
 	  if (!cp.supportsSetDesktopSize)
 	    throw new Exception("Server does not support SetDesktopSize");
-	
+
 	  startMsg(MsgTypes.msgTypeSetDesktopSize);
 	  os.pad(1);
-	
+
 	  os.writeU16(width);
 	  os.writeU16(height);
-	
+
 	  os.writeU8(layout.num_screens());
 	  os.pad(1);
-	
+
     for (Iterator<Screen> iter = layout.screens.iterator(); iter.hasNext(); ) {
       Screen refScreen = (Screen)iter.next();
 	    os.writeU32(refScreen.id);
@@ -64,7 +64,7 @@
 	    os.writeU16(refScreen.dimensions.height());
 	    os.writeU32(refScreen.flags);
 	  }
-	
+
 	  endMsg();
 	}
 
@@ -76,33 +76,33 @@
       throw new Exception("Too large fence payload");
     if ((flags & ~fenceTypes.fenceFlagsSupported) != 0)
       throw new Exception("Unknown fence flags");
-  
+
     startMsg(MsgTypes.msgTypeClientFence);
     os.pad(3);
-  
+
     os.writeU32(flags);
-  
+
     os.writeU8(len);
     os.writeBytes(data, 0, len);
-  
+
     endMsg();
   }
-  
+
   synchronized public void writeEnableContinuousUpdates(boolean enable,
                                            int x, int y, int w, int h)
   {
     if (!cp.supportsContinuousUpdates)
       throw new Exception("Server does not support continuous updates");
-  
+
     startMsg(MsgTypes.msgTypeEnableContinuousUpdates);
-  
+
     os.writeU8((enable?1:0));
-  
+
     os.writeU16(x);
     os.writeU16(y);
     os.writeU16(w);
     os.writeU16(h);
-  
+
     endMsg();
   }
 }
diff --git a/java/com/tigervnc/rfb/CSecurity.java b/java/com/tigervnc/rfb/CSecurity.java
index 96d5200..f67680c 100644
--- a/java/com/tigervnc/rfb/CSecurity.java
+++ b/java/com/tigervnc/rfb/CSecurity.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -37,7 +37,7 @@
   abstract public boolean processMsg(CConnection cc);
   abstract public int getType();
   abstract public String description();
-  
+
   /*
    * Use variable directly instead of dumb get/set methods.
    * It MUST be set by viewer.
diff --git a/java/com/tigervnc/rfb/CSecurityIdent.java b/java/com/tigervnc/rfb/CSecurityIdent.java
index 50836b8..9eb6e0b 100644
--- a/java/com/tigervnc/rfb/CSecurityIdent.java
+++ b/java/com/tigervnc/rfb/CSecurityIdent.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/CSecurityNone.java b/java/com/tigervnc/rfb/CSecurityNone.java
index d17741f..0475be5 100644
--- a/java/com/tigervnc/rfb/CSecurityNone.java
+++ b/java/com/tigervnc/rfb/CSecurityNone.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/CSecurityPlain.java b/java/com/tigervnc/rfb/CSecurityPlain.java
index b0504a5..d6f8ffd 100644
--- a/java/com/tigervnc/rfb/CSecurityPlain.java
+++ b/java/com/tigervnc/rfb/CSecurityPlain.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2005 Martin Koegler
  * Copyright (C) 2010 TigerVNC Team
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -27,7 +27,7 @@
 
   public CSecurityPlain() { }
 
-  public boolean processMsg(CConnection cc) 
+  public boolean processMsg(CConnection cc)
   {
     OutStream os = cc.getOutStream();
 
diff --git a/java/com/tigervnc/rfb/CSecurityStack.java b/java/com/tigervnc/rfb/CSecurityStack.java
index 6cca76b..e4f5988 100644
--- a/java/com/tigervnc/rfb/CSecurityStack.java
+++ b/java/com/tigervnc/rfb/CSecurityStack.java
@@ -2,17 +2,17 @@
  * Copyright (C) 2006 OCCAM Financial Technology
  * Copyright (C) 2010 TigerVNC Team
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -27,35 +27,35 @@
   			       CSecurity s1)
   {
     name = Name;
-    type = Type; 
+    type = Type;
     state = 0;
     state0 = s0;
     state1 = s1;
   }
-  
+
   public boolean processMsg(CConnection cc)
   {
     boolean res = true;
     if (state == 0) {
       if (state0 != null)
         res = state0.processMsg(cc);
-  
+
       if (!res)
         return res;
-  
+
       state++;
     }
-  
+
     if (state == 1) {
       if(state1 != null)
         res = state1.processMsg(cc);
-  
+
       if(!res)
         return res;
-  
+
       state++;
     }
-  
+
     return res;
   }
 
diff --git a/java/com/tigervnc/rfb/CSecurityTLS.java b/java/com/tigervnc/rfb/CSecurityTLS.java
index 4486eef..86a3caf 100644
--- a/java/com/tigervnc/rfb/CSecurityTLS.java
+++ b/java/com/tigervnc/rfb/CSecurityTLS.java
@@ -47,7 +47,7 @@
   = new StringParameter("x509crl",
                         "X509 CRL file", "", Configuration.ConfigurationObject.ConfViewer);
 
-  private void initGlobal() 
+  private void initGlobal()
   {
     boolean globalInitDone = false;
 
@@ -62,14 +62,14 @@
     }
   }
 
-  public CSecurityTLS(boolean _anon) 
+  public CSecurityTLS(boolean _anon)
   {
     anon = _anon;
     session = null;
-    
+
     setDefaults();
-    cafile = x509ca.getData(); 
-    crlfile = x509crl.getData(); 
+    cafile = x509ca.getData();
+    crlfile = x509crl.getData();
   }
 
   public static String getDefaultCA() {
@@ -119,7 +119,7 @@
           reason = new String("Authentication failure (protocol error)");
         throw new AuthFailureException(reason);
       }
-      
+
       setParam();
 
     }
@@ -153,8 +153,8 @@
       }
     } else {
       try {
-        TrustManager[] myTM = new TrustManager[] { 
-          new MyX509TrustManager() 
+        TrustManager[] myTM = new TrustManager[] {
+          new MyX509TrustManager()
         };
         ctx.init (null, myTM, null);
       } catch (java.security.GeneralSecurityException e) {
@@ -223,7 +223,7 @@
           params.setRevocationEnabled(true);
         }
         tmf.init(new CertPathTrustManagerParameters(params));
-      } catch (java.io.FileNotFoundException e) { 
+      } catch (java.io.FileNotFoundException e) {
         vlog.error(e.toString());
       } catch (java.io.IOException e) {
         vlog.error(e.toString());
@@ -231,7 +231,7 @@
       tm = (X509TrustManager)tmf.getTrustManagers()[0];
     }
 
-    public void checkClientTrusted(X509Certificate[] chain, String authType) 
+    public void checkClientTrusted(X509Certificate[] chain, String authType)
       throws CertificateException
     {
       tm.checkClientTrusted(chain, authType);
@@ -264,7 +264,7 @@
   }
 
   public final int getType() { return anon ? Security.secTypeTLSNone : Security.secTypeX509None; }
-  public final String description() 
+  public final String description()
     { return anon ? "TLS Encryption without VncAuth" : "X509 Encryption without VncAuth"; }
 
   //protected void checkSession();
diff --git a/java/com/tigervnc/rfb/CSecurityVeNCrypt.java b/java/com/tigervnc/rfb/CSecurityVeNCrypt.java
index 528158c..f353874 100644
--- a/java/com/tigervnc/rfb/CSecurityVeNCrypt.java
+++ b/java/com/tigervnc/rfb/CSecurityVeNCrypt.java
@@ -28,7 +28,7 @@
 
 public class CSecurityVeNCrypt extends CSecurity {
 
-  public CSecurityVeNCrypt(SecurityClient sec) 
+  public CSecurityVeNCrypt(SecurityClient sec)
   {
     haveRecvdMajorVersion = false;
     haveRecvdMinorVersion = false;
@@ -54,7 +54,7 @@
     if (!haveRecvdMinorVersion) {
       minorVersion = is.readU8();
       haveRecvdMinorVersion = true;
-      
+
       return false;
     }
 
@@ -83,7 +83,7 @@
         os.flush();
 	      throw new Exception("Server reported an unsupported VeNCrypt version");
       }
-    
+
       haveSentVersion = true;
       return false;
     }
@@ -101,7 +101,7 @@
     if (!haveNumberOfTypes) {
       nAvailableTypes = is.readU8();
       iAvailableType = 0;
-  
+
       if (nAvailableTypes <= 0)
 	      throw new Exception("The server reported no VeNCrypt sub-types");
 
diff --git a/java/com/tigervnc/rfb/CSecurityVncAuth.java b/java/com/tigervnc/rfb/CSecurityVncAuth.java
index 87d823f..e053e41 100644
--- a/java/com/tigervnc/rfb/CSecurityVncAuth.java
+++ b/java/com/tigervnc/rfb/CSecurityVncAuth.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -27,7 +27,7 @@
 
   private static final int vncAuthChallengeSize = 16;
 
-  public boolean processMsg(CConnection cc) 
+  public boolean processMsg(CConnection cc)
   {
     InStream is = cc.getInStream();
     OutStream os = cc.getOutStream();
diff --git a/java/com/tigervnc/rfb/Configuration.java b/java/com/tigervnc/rfb/Configuration.java
index fb635c7..5d140d9 100644
--- a/java/com/tigervnc/rfb/Configuration.java
+++ b/java/com/tigervnc/rfb/Configuration.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2004-2005 Cendio AB.
  * Copyright 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -45,19 +45,19 @@
     if (global_ == null)
       global_ = new Configuration("Global");
     return global_;
-  } 
+  }
 
   public static Configuration server() {
     if (server_ == null)
       server_ = new Configuration("Server");
     return server_;
-  } 
+  }
 
   public static Configuration viewer() {
     if (viewer_ == null)
       viewer_ = new Configuration("Viewer");
     return viewer_;
-  } 
+  }
 
   // Enable server/viewer specific parameters
   public static void enableServerParams() { global().appendConfiguration(server()); }
@@ -124,8 +124,8 @@
           current.getName().equalsIgnoreCase(name.substring(0, len)))
       {
         boolean b = current.setParam(val);
-        current.setHasBeenSet(); 
-        if (b && immutable) 
+        current.setHasBeenSet();
+        if (b && immutable)
   	  current.setImmutable();
         return b;
       }
@@ -150,14 +150,14 @@
       while (current != null) {
         if (current.getName().equalsIgnoreCase(config)) {
           boolean b = current.setParam();
-  	  current.setHasBeenSet(); 
-          if (b && immutable) 
+  	  current.setHasBeenSet();
+          if (b && immutable)
   	    current.setImmutable();
           return b;
         }
         current = current._next;
       }
-    }    
+    }
     return (_next != null) ? _next.set(config, immutable) : false;
   }
 
@@ -174,11 +174,11 @@
     return setParam(param, value, false);
   }
 
-  public static boolean setParam(String config, boolean immutable) { 
+  public static boolean setParam(String config, boolean immutable) {
     return global().set(config, immutable);
   }
 
-  public static boolean setParam(String config) { 
+  public static boolean setParam(String config) {
     return setParam(config, false);
   }
 
@@ -199,7 +199,7 @@
     }
     return (_next != null) ? _next.get(param) : null;
   }
-  
+
   public static VoidParameter getParam(String param) { return global().get(param); }
 
   public static void listParams(int width, int nameWidth) {
@@ -211,7 +211,7 @@
 
   public void list(int width, int nameWidth) {
     VoidParameter current = head;
-  
+
     System.err.format("%s Parameters:%n", name);
     while (current != null) {
       String def_str = current.getDefaultStr();
@@ -226,7 +226,7 @@
         int wordLen;
         if (s > -1) wordLen = s;
         else wordLen = desc.length();
-  
+
         if (column + wordLen + 1 > width) {
           format = "%n%"+(nameWidth+4)+"s";
           System.err.format(format, "");
@@ -239,7 +239,7 @@
         if (s == -1) break;
         desc = desc.substring(wordLen+1);
       }
-  
+
       if (def_str != null) {
         if (column + def_str.length() + 11 > width)
           System.err.format("%n%"+(nameWidth+4)+"s","");
@@ -250,7 +250,7 @@
       }
       current = current._next;
     }
-  
+
     if (_next != null)
       _next.list(width, nameWidth);
   }
diff --git a/java/com/tigervnc/rfb/ConnFailedException.java b/java/com/tigervnc/rfb/ConnFailedException.java
index e3a55bc..7c32914 100644
--- a/java/com/tigervnc/rfb/ConnFailedException.java
+++ b/java/com/tigervnc/rfb/ConnFailedException.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/ConnParams.java b/java/com/tigervnc/rfb/ConnParams.java
index 058019b..f1f5395 100644
--- a/java/com/tigervnc/rfb/ConnParams.java
+++ b/java/com/tigervnc/rfb/ConnParams.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 D. R. Commander.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -44,7 +44,7 @@
     setName("");
   }
 
-  public boolean readVersion(InStream is) 
+  public boolean readVersion(InStream is)
   {
     done = false;
     if (verStrPos >= 12) return false;
@@ -104,7 +104,7 @@
   }
 
   public String name() { return name_; }
-  public void setName(String name) 
+  public void setName(String name)
   {
     name_ = name;
   }
diff --git a/java/com/tigervnc/rfb/Cursor.java b/java/com/tigervnc/rfb/Cursor.java
index a6b058f..78aa0fb 100644
--- a/java/com/tigervnc/rfb/Cursor.java
+++ b/java/com/tigervnc/rfb/Cursor.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/Decoder.java b/java/com/tigervnc/rfb/Decoder.java
index 9e37f8e..f0ece0a 100644
--- a/java/com/tigervnc/rfb/Decoder.java
+++ b/java/com/tigervnc/rfb/Decoder.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -22,14 +22,14 @@
 
   abstract public void readRect(Rect r, CMsgHandler handler);
 
-  static public boolean supported(int encoding) 
+  static public boolean supported(int encoding)
   {
 /*
     return encoding <= Encodings.encodingMax && createFns[encoding];
 */
-    return (encoding == Encodings.encodingRaw || 
+    return (encoding == Encodings.encodingRaw ||
             encoding == Encodings.encodingRRE ||
-            encoding == Encodings.encodingHextile || 
+            encoding == Encodings.encodingHextile ||
             encoding == Encodings.encodingTight ||
             encoding == Encodings.encodingZRLE);
   }
diff --git a/java/com/tigervnc/rfb/DesCipher.java b/java/com/tigervnc/rfb/DesCipher.java
index f7ae9db..ac66406 100644
--- a/java/com/tigervnc/rfb/DesCipher.java
+++ b/java/com/tigervnc/rfb/DesCipher.java
@@ -20,16 +20,16 @@
 //
 // Permission to use, copy, modify, and distribute this software
 // and its documentation for NON-COMMERCIAL or COMMERCIAL purposes and
-// without fee is hereby granted, provided that this copyright notice is kept 
-// intact. 
-// 
+// without fee is hereby granted, provided that this copyright notice is kept
+// intact.
+//
 // WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
 // OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
 // TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 // PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE LIABLE
 // FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
 // DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
-// 
+//
 // THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
 // CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
 // PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
@@ -475,7 +475,7 @@
     public static void squashBytesToInts( byte[] inBytes, int inOff, int[] outInts, int outOff, int intLen )
         {
 	for ( int i = 0; i < intLen; ++i )
-	    outInts[outOff + i] = 
+	    outInts[outOff + i] =
 		( ( inBytes[inOff + i * 4    ] & 0xff ) << 24 ) |
 		( ( inBytes[inOff + i * 4 + 1] & 0xff ) << 16 ) |
 		( ( inBytes[inOff + i * 4 + 2] & 0xff ) <<  8 ) |
diff --git a/java/com/tigervnc/rfb/Encoder.java b/java/com/tigervnc/rfb/Encoder.java
index bfb03f5..5b4eb0c 100644
--- a/java/com/tigervnc/rfb/Encoder.java
+++ b/java/com/tigervnc/rfb/Encoder.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/Encodings.java b/java/com/tigervnc/rfb/Encodings.java
index fdb6881..ec2331e 100644
--- a/java/com/tigervnc/rfb/Encodings.java
+++ b/java/com/tigervnc/rfb/Encodings.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 D. R. Commander.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/Exception.java b/java/com/tigervnc/rfb/Exception.java
index ef7fa81..5b879a2 100644
--- a/java/com/tigervnc/rfb/Exception.java
+++ b/java/com/tigervnc/rfb/Exception.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/Hextile.java b/java/com/tigervnc/rfb/Hextile.java
index 0b8c8c6..99ed0b3 100644
--- a/java/com/tigervnc/rfb/Hextile.java
+++ b/java/com/tigervnc/rfb/Hextile.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/HextileDecoder.java b/java/com/tigervnc/rfb/HextileDecoder.java
index 0f2b490..94e91f7 100644
--- a/java/com/tigervnc/rfb/HextileDecoder.java
+++ b/java/com/tigervnc/rfb/HextileDecoder.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/Hostname.java b/java/com/tigervnc/rfb/Hostname.java
index 2e64d03..c7e5659 100644
--- a/java/com/tigervnc/rfb/Hostname.java
+++ b/java/com/tigervnc/rfb/Hostname.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/IntParameter.java b/java/com/tigervnc/rfb/IntParameter.java
index d949710..dcad04a 100644
--- a/java/com/tigervnc/rfb/IntParameter.java
+++ b/java/com/tigervnc/rfb/IntParameter.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2004-2005 Cendio AB.
  * Copyright 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -22,7 +22,7 @@
 
 public class IntParameter extends VoidParameter {
   public IntParameter(String name_, String desc_, int v,
-                      int minValue_, int maxValue_, 
+                      int minValue_, int maxValue_,
                       Configuration.ConfigurationObject co)
   {
     super(name_, desc_, co);
@@ -32,7 +32,7 @@
     maxValue = maxValue_;
   }
 
-  public IntParameter(String name_, String desc_, int v) 
+  public IntParameter(String name_, String desc_, int v)
   {
     this(name_, desc_, v, Integer.MIN_VALUE, Integer.MAX_VALUE,
          Configuration.ConfigurationObject.ConfGlobal);
diff --git a/java/com/tigervnc/rfb/JpegCompressor.java b/java/com/tigervnc/rfb/JpegCompressor.java
index 626983b..1e1abd3 100644
--- a/java/com/tigervnc/rfb/JpegCompressor.java
+++ b/java/com/tigervnc/rfb/JpegCompressor.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 D. R. Commander.  All Rights Reserved.
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -20,13 +20,13 @@
 package com.tigervnc.rfb;
 
 public class JpegCompressor {
-  
+
   public static final int SUBSAMP_UNDEFINED = -1;
   public static final int SUBSAMP_NONE = 0;
   public static final int SUBSAMP_420 = 1;
   public static final int SUBSAMP_422 = 2;
   public static final int SUBSAMP_GRAY = 3;
-  
+
   public static int subsamplingNum(String name) {
     if (name.equalsIgnoreCase("SUBSAMP_UNDEFINED")) return SUBSAMP_UNDEFINED;
     if (name.equalsIgnoreCase("SUBSAMP_NONE"))      return SUBSAMP_NONE;
diff --git a/java/com/tigervnc/rfb/LogWriter.java b/java/com/tigervnc/rfb/LogWriter.java
index fc9478c..ca7d06a 100644
--- a/java/com/tigervnc/rfb/LogWriter.java
+++ b/java/com/tigervnc/rfb/LogWriter.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/ManagedPixelBuffer.java b/java/com/tigervnc/rfb/ManagedPixelBuffer.java
index a4d5943..f947af7 100644
--- a/java/com/tigervnc/rfb/ManagedPixelBuffer.java
+++ b/java/com/tigervnc/rfb/ManagedPixelBuffer.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/MsgTypes.java b/java/com/tigervnc/rfb/MsgTypes.java
index a793f1e..c12f38d 100644
--- a/java/com/tigervnc/rfb/MsgTypes.java
+++ b/java/com/tigervnc/rfb/MsgTypes.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/PixelBuffer.java b/java/com/tigervnc/rfb/PixelBuffer.java
index 29d607e..a46667d 100644
--- a/java/com/tigervnc/rfb/PixelBuffer.java
+++ b/java/com/tigervnc/rfb/PixelBuffer.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -36,11 +36,11 @@
       throw new Exception("Internal error: bpp must be 8, 16, or 32 in PixelBuffer ("+pf.bpp+")");
     format = pf;
     switch (pf.depth) {
-    case  3: 
+    case  3:
       // Fall-through to depth 8
-    case  6: 
+    case  6:
       // Fall-through to depth 8
-    case  8: 
+    case  8:
       if (!pf.trueColour) {
         if (cm == null)
           cm = new IndexColorModel(8, 256, new byte[256], new byte[256], new byte[256]);
@@ -51,14 +51,14 @@
       int bmask = pf.blueMax << pf.blueShift;
       cm = new DirectColorModel(8, rmask, gmask, bmask);
       break;
-    case 16: 
+    case 16:
       cm = new DirectColorModel(32, 0xF800, 0x07C0, 0x003E);
       break;
-    case 24: 
+    case 24:
       cm = new DirectColorModel(32, (0xff << 16), (0xff << 8), 0xff);
       break;
-    case 32: 
-      cm = new DirectColorModel(32, (0xff << pf.redShift), 
+    case 32:
+      cm = new DirectColorModel(32, (0xff << pf.redShift),
         (0xff << pf.greenShift), (0xff << pf.blueShift));
       break;
     default:
@@ -103,10 +103,10 @@
 
   public void maskRect(int x, int y, int w, int h, int[] pix, byte[] mask) {
     int maskBytesPerRow = (w + 7) / 8;
-    
+
     for (int j = 0; j < h; j++) {
       int cy = y + j;
-      
+
       if (cy < 0 || cy >= height_)
         continue;
 
@@ -121,7 +121,7 @@
 
         if ((mask[byte_] & (1 << bit)) != 0)
          data[cy * width_ + cx] = pix[j * w + i];
-      }     
+      }
     }
   }
 
diff --git a/java/com/tigervnc/rfb/PixelFormat.java b/java/com/tigervnc/rfb/PixelFormat.java
index 1e12c4c..c4d6870 100644
--- a/java/com/tigervnc/rfb/PixelFormat.java
+++ b/java/com/tigervnc/rfb/PixelFormat.java
@@ -2,17 +2,17 @@
  * Copyright 2009 Pierre Ossman for Cendio AB
  * Copyright (C) 2011 D. R. Commander.  All Rights Reserved.
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -106,7 +106,7 @@
     return true;
   }
 
-  public int pixelFromRGB(int red, int green, int blue, ColorModel cm) 
+  public int pixelFromRGB(int red, int green, int blue, ColorModel cm)
   {
     if (trueColour) {
       int r = (red   * redMax     + 32767) / 65535;
@@ -139,7 +139,7 @@
     return 0;
   }
 
-  public void bufferFromRGB(int[] dst, int dstPtr, byte[] src, 
+  public void bufferFromRGB(int[] dst, int dstPtr, byte[] src,
                             int srcPtr, int pixels) {
     if (is888()) {
       // Optimised common case
@@ -162,7 +162,7 @@
       // Generic code
       int p, r, g, b;
       int[] rgb = new int[4];
-      
+
       int i = srcPtr; int j = dstPtr;
       while (i < pixels) {
         r = src[i++] & 0xff;
@@ -182,11 +182,11 @@
   {
     int p;
     byte r, g, b;
-  
+
     for (int i=0; i < pixels; i++) {
-      p = pixelFromBuffer(src, srcPtr); 
+      p = pixelFromBuffer(src, srcPtr);
       srcPtr += bpp/8;
-  
+
       dst[dstPtr++] = (byte)cm.getRed(p);
       dst[dstPtr++] = (byte)cm.getGreen(p);
       dst[dstPtr++] = (byte)cm.getBlue(p);
@@ -196,9 +196,9 @@
   public int pixelFromBuffer(byte[] buffer, int bufferPtr)
   {
     int p;
-  
+
     p = 0;
-  
+
     if (bigEndian) {
       switch (bpp) {
       case 32:
@@ -221,7 +221,7 @@
         }
       }
     }
-  
+
     return p;
   }
 
@@ -289,7 +289,7 @@
       }
     }
   }
-          
+
 
   public int bpp;
   public int depth;
diff --git a/java/com/tigervnc/rfb/Point.java b/java/com/tigervnc/rfb/Point.java
index 3a5f3e9..74c8e11 100644
--- a/java/com/tigervnc/rfb/Point.java
+++ b/java/com/tigervnc/rfb/Point.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/RREDecoder.java b/java/com/tigervnc/rfb/RREDecoder.java
index 97cb7ed..cf74bf5 100644
--- a/java/com/tigervnc/rfb/RREDecoder.java
+++ b/java/com/tigervnc/rfb/RREDecoder.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/RawDecoder.java b/java/com/tigervnc/rfb/RawDecoder.java
index 22ea30b..b2219a2 100644
--- a/java/com/tigervnc/rfb/RawDecoder.java
+++ b/java/com/tigervnc/rfb/RawDecoder.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/Rect.java b/java/com/tigervnc/rfb/Rect.java
index 67ece1d..0914f2f 100644
--- a/java/com/tigervnc/rfb/Rect.java
+++ b/java/com/tigervnc/rfb/Rect.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -36,12 +36,12 @@
     tl=new Point(0,0);
     br=new Point(0,0);
   }
-  public Rect(Point tl_, Point br_) { 
+  public Rect(Point tl_, Point br_) {
     tl=new Point(tl_.x, tl_.y);
     br=new Point(br_.x,br_.y);
   }
   public Rect(int x1, int y1, int x2, int y2) {
-    tl=new Point(x1, y1); 
+    tl=new Point(x1, y1);
     br=new Point(x2, y2);
   }
   public final void setXYWH(int x, int y, int w, int h) {
diff --git a/java/com/tigervnc/rfb/Screen.java b/java/com/tigervnc/rfb/Screen.java
index a7b094f..c9ab98a 100644
--- a/java/com/tigervnc/rfb/Screen.java
+++ b/java/com/tigervnc/rfb/Screen.java
@@ -1,16 +1,16 @@
 /* Copyright 2009 Pierre Ossman for Cendio AB
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/ScreenSet.java b/java/com/tigervnc/rfb/ScreenSet.java
index d20374f..a14f561 100644
--- a/java/com/tigervnc/rfb/ScreenSet.java
+++ b/java/com/tigervnc/rfb/ScreenSet.java
@@ -1,15 +1,15 @@
 /* Copyright 2009 Pierre Ossman for Cendio AB
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -34,7 +34,7 @@
   public final int num_screens() { return screens.size(); }
 
   public final void add_screen(Screen screen) { screens.add(screen); }
-  public final void remove_screen(int id) { 
+  public final void remove_screen(int id) {
     for (Iterator<Screen> iter = screens.iterator(); iter.hasNext(); ) {
       Screen refScreen = (Screen)iter.next();
       if (refScreen.id == id)
diff --git a/java/com/tigervnc/rfb/Security.java b/java/com/tigervnc/rfb/Security.java
index 9df4995..d841c63 100644
--- a/java/com/tigervnc/rfb/Security.java
+++ b/java/com/tigervnc/rfb/Security.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2010 TigerVNC Team
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -82,7 +82,7 @@
       if (refType < 0x100)
         result.add(refType);
     }
-    
+
     return (result);
   }
 
@@ -112,13 +112,13 @@
   public boolean IsSupported(int secType)
   {
     Iterator<Integer> i;
-  
+
     for (i = enabledSecTypes.iterator(); i.hasNext(); )
      if ((Integer)i.next() == secType)
        return true;
     if (secType == secTypeVeNCrypt)
      return true;
-  
+
     return false;
   }
 
diff --git a/java/com/tigervnc/rfb/SecurityClient.java b/java/com/tigervnc/rfb/SecurityClient.java
index 3fb919a..59499b1 100644
--- a/java/com/tigervnc/rfb/SecurityClient.java
+++ b/java/com/tigervnc/rfb/SecurityClient.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2010 TigerVNC Team
  * Copyright (C) 2011-2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -30,10 +30,10 @@
   {
     assert (CConn.upg != null); /* (upg == null) means bug in the viewer */
     assert (msg != null);
-  
+
     if (!IsSupported(secType))
       throw new Exception("Security type not supported");
-  
+
     switch (secType) {
     case Security.secTypeNone: return (new CSecurityNone());
     case Security.secTypeVncAuth: return (new CSecurityVncAuth());
@@ -67,7 +67,7 @@
     default:
       throw new Exception("Security type not supported");
     }
-  
+
   }
 
   public static void setDefaults()
@@ -78,7 +78,7 @@
   //UserPasswdGetter upg = null;
   String msg = null;
 
-  static StringParameter secTypes 
+  static StringParameter secTypes
   = new StringParameter("SecurityTypes",
                         "Specify which security scheme to use (None, VncAuth)",
                         "Ident,TLSIdent,X509Ident,X509Plain,TLSPlain,X509Vnc,TLSVnc,X509None,TLSNone,VncAuth,None", Configuration.ConfigurationObject.ConfViewer);
diff --git a/java/com/tigervnc/rfb/StringParameter.java b/java/com/tigervnc/rfb/StringParameter.java
index 4805038..001e914 100644
--- a/java/com/tigervnc/rfb/StringParameter.java
+++ b/java/com/tigervnc/rfb/StringParameter.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2004-2005 Cendio AB.
  * Copyright 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -21,15 +21,15 @@
 package com.tigervnc.rfb;
 
 public class StringParameter extends VoidParameter {
-  public StringParameter(String name_, String desc_, String v, 
-                         Configuration.ConfigurationObject co) 
+  public StringParameter(String name_, String desc_, String v,
+                         Configuration.ConfigurationObject co)
   {
     super(name_, desc_, co);
     value = v;
     defValue = v;
   }
 
-  public StringParameter(String name_, String desc_, String v) 
+  public StringParameter(String name_, String desc_, String v)
   {
     this(name_, desc_, v, Configuration.ConfigurationObject.ConfGlobal);
   }
diff --git a/java/com/tigervnc/rfb/TightDecoder.java b/java/com/tigervnc/rfb/TightDecoder.java
index d592b36..b644cdb 100644
--- a/java/com/tigervnc/rfb/TightDecoder.java
+++ b/java/com/tigervnc/rfb/TightDecoder.java
@@ -2,17 +2,17 @@
  * Copyright 2004-2005 Cendio AB.
  * Copyright (C) 2011 D. R. Commander.  All Rights Reserved.
  * Copyright (C) 2011-2012 Brian P. Hinz
- *    
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -46,14 +46,14 @@
 
   final static Toolkit tk = Toolkit.getDefaultToolkit();
 
-  public TightDecoder(CMsgReader reader_) { 
-    reader = reader_; 
+  public TightDecoder(CMsgReader reader_) {
+    reader = reader_;
     zis = new ZlibInStream[4];
     for (int i = 0; i < 4; i++)
       zis[i] = new ZlibInStream();
   }
 
-  public void readRect(Rect r, CMsgHandler handler) 
+  public void readRect(Rect r, CMsgHandler handler)
   {
     InStream is = reader.getInStream();
     boolean cutZeros = false;
@@ -198,7 +198,7 @@
     } else {
       // Indexed color
       int x, h = r.height(), w = r.width(), b, pad = stride - w;
-      int ptr = 0; 
+      int ptr = 0;
       int srcPtr = 0, bits;
       if (palSize <= 2) {
         // 2-color palette
@@ -229,7 +229,7 @@
           h--;
         }
       }
-    } 
+    }
 
     handler.imageRect(r, buf);
 
@@ -238,7 +238,7 @@
     }
   }
 
-  final private void DECOMPRESS_JPEG_RECT(Rect r, InStream is, CMsgHandler handler) 
+  final private void DECOMPRESS_JPEG_RECT(Rect r, InStream is, CMsgHandler handler)
   {
     // Read length
     int compressedLen = is.readCompactLength();
@@ -256,7 +256,7 @@
     jpeg.flush();
   }
 
-  final private void FilterGradient24(byte[] netbuf, int[] buf, int stride, 
+  final private void FilterGradient24(byte[] netbuf, int[] buf, int stride,
                                       Rect r)
   {
 
@@ -297,7 +297,7 @@
     }
   }
 
-  final private void FilterGradient(byte[] netbuf, int[] buf, int stride, 
+  final private void FilterGradient(byte[] netbuf, int[] buf, int stride,
                                     Rect r)
   {
 
@@ -321,7 +321,7 @@
       System.arraycopy(pix, 0, thisRow, 0, pix.length);
 
       serverpf.bufferFromRGB(buf, y*stride, pix, 0, 1);
-      
+
       /* Remaining pixels of a row */
       for (x = 1; x < rectWidth; x++) {
         for (c = 0; c < 3; c++) {
diff --git a/java/com/tigervnc/rfb/UnicodeToKeysym.java b/java/com/tigervnc/rfb/UnicodeToKeysym.java
index fdbfd0f..576a2a9 100644
--- a/java/com/tigervnc/rfb/UnicodeToKeysym.java
+++ b/java/com/tigervnc/rfb/UnicodeToKeysym.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/UserMsgBox.java b/java/com/tigervnc/rfb/UserMsgBox.java
index 4b53c9b..7b184c6 100644
--- a/java/com/tigervnc/rfb/UserMsgBox.java
+++ b/java/com/tigervnc/rfb/UserMsgBox.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/UserPasswdGetter.java b/java/com/tigervnc/rfb/UserPasswdGetter.java
index 6183d36..feb05ed 100644
--- a/java/com/tigervnc/rfb/UserPasswdGetter.java
+++ b/java/com/tigervnc/rfb/UserPasswdGetter.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/VncAuth.java b/java/com/tigervnc/rfb/VncAuth.java
index f3d6072..e9ae672 100644
--- a/java/com/tigervnc/rfb/VncAuth.java
+++ b/java/com/tigervnc/rfb/VncAuth.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/VoidParameter.java b/java/com/tigervnc/rfb/VoidParameter.java
index 33c8bcb..2af0a81 100644
--- a/java/com/tigervnc/rfb/VoidParameter.java
+++ b/java/com/tigervnc/rfb/VoidParameter.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright 2004-2005 Cendio AB.
  * Copyright 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -21,8 +21,8 @@
 package com.tigervnc.rfb;
 
 abstract public class VoidParameter {
-  public VoidParameter(String name_, String desc_, 
-                       Configuration.ConfigurationObject co) 
+  public VoidParameter(String name_, String desc_,
+                       Configuration.ConfigurationObject co)
   {
     immutable = false; _hasBeenSet = false; name = name_; description = desc_;
 
@@ -47,11 +47,11 @@
     this(name_, desc_, Configuration.ConfigurationObject.ConfGlobal);
   }
 
-  final public String getName() { 
+  final public String getName() {
     return name;
   }
 
-  final public String getDescription() { 
+  final public String getDescription() {
     return description;
   }
 
diff --git a/java/com/tigervnc/rfb/ZRLEDecoder.java b/java/com/tigervnc/rfb/ZRLEDecoder.java
index bb4d7a6..e706510 100644
--- a/java/com/tigervnc/rfb/ZRLEDecoder.java
+++ b/java/com/tigervnc/rfb/ZRLEDecoder.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -52,7 +52,7 @@
         int[] palette = new int[128];
 
         zis.readPixels(palette, palSize, bytesPerPixel, bigEndian);
-        
+
         if (palSize == 1) {
           int pix = palette[0];
           handler.fillRect(t, pix);
diff --git a/java/com/tigervnc/rfb/fenceTypes.java b/java/com/tigervnc/rfb/fenceTypes.java
index 3486d0e..de2a709 100644
--- a/java/com/tigervnc/rfb/fenceTypes.java
+++ b/java/com/tigervnc/rfb/fenceTypes.java
@@ -1,16 +1,16 @@
 /* Copyright 2011 Pierre Ossman for Cendio AB
  * Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/rfb/screenTypes.java b/java/com/tigervnc/rfb/screenTypes.java
index 9f69932..36b9603 100644
--- a/java/com/tigervnc/rfb/screenTypes.java
+++ b/java/com/tigervnc/rfb/screenTypes.java
@@ -1,16 +1,16 @@
 /* Copyright 2009 Pierre Ossman for Cendio AB
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/vncviewer/BIPixelBuffer.java b/java/com/tigervnc/vncviewer/BIPixelBuffer.java
index ae38302..9612b36 100644
--- a/java/com/tigervnc/vncviewer/BIPixelBuffer.java
+++ b/java/com/tigervnc/vncviewer/BIPixelBuffer.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2012 Brian P. Hinz
  * Copyright (C) 2012 D. R. Commander.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -41,7 +41,7 @@
     super.updateColourMap();
     createImage(width_, height_);
   }
-  
+
   // resize() resizes the image, preserving the image data where possible.
   public void resize(int w, int h) {
     if (w == width() && h == height())
@@ -67,14 +67,14 @@
     Graphics2D graphics = (Graphics2D)image.getGraphics();
     switch (format.depth) {
     case 24:
-      graphics.setColor(new Color(pix)); 
-      graphics.fillRect(x, y, w, h); 
+      graphics.setColor(new Color(pix));
+      graphics.fillRect(x, y, w, h);
       break;
     default:
       Color color = new Color((0xff << 24) | (cm.getRed(pix) << 16) |
                               (cm.getGreen(pix) << 8) | (cm.getBlue(pix)));
-      graphics.setColor(color); 
-      graphics.fillRect(x, y, w, h); 
+      graphics.setColor(color);
+      graphics.fillRect(x, y, w, h);
       break;
     }
     graphics.dispose();
@@ -83,7 +83,7 @@
   public void imageRect(int x, int y, int w, int h, Object pix) {
     if (pix instanceof Image) {
       Image img = (Image)pix;
-      clip = new Rectangle(x, y, w, h); 
+      clip = new Rectangle(x, y, w, h);
       synchronized(clip) {
         tk.prepareImage(img, -1, -1, this);
         try {
@@ -91,7 +91,7 @@
         } catch (InterruptedException e) {
           throw new Exception("Error decoding JPEG data");
         }
-      } 
+      }
       clip = null;
       img.flush();
     } else {
@@ -101,7 +101,7 @@
           bytes[i] = (byte)((int[])pix)[i];
         pix = bytes;
       }
-      image.getSampleModel().setDataElements(x, y, w, h, pix, db); 
+      image.getSampleModel().setDataElements(x, y, w, h, pix, db);
     }
   }
 
@@ -123,7 +123,7 @@
         if (clip != null) {
           synchronized(clip) {
             Graphics2D graphics = (Graphics2D)image.getGraphics();
-            graphics.drawImage(img, clip.x, clip.y, clip.width, clip.height, null); 
+            graphics.drawImage(img, clip.x, clip.y, clip.width, clip.height, null);
             graphics.dispose();
             clip.notify();
           }
diff --git a/java/com/tigervnc/vncviewer/CConn.java b/java/com/tigervnc/vncviewer/CConn.java
index 97ba9da..15521aa 100644
--- a/java/com/tigervnc/vncviewer/CConn.java
+++ b/java/com/tigervnc/vncviewer/CConn.java
@@ -61,11 +61,11 @@
 {
 
   public final PixelFormat getPreferredPF() { return fullColourPF; }
-  static final PixelFormat verylowColourPF = 
+  static final PixelFormat verylowColourPF =
     new PixelFormat(8, 3, false, true, 1, 1, 1, 2, 1, 0);
-  static final PixelFormat lowColourPF = 
+  static final PixelFormat lowColourPF =
     new PixelFormat(8, 6, false, true, 3, 3, 3, 4, 2, 0);
-  static final PixelFormat mediumColourPF = 
+  static final PixelFormat mediumColourPF =
     new PixelFormat(8, 8, false, false, 7, 7, 3, 0, 3, 6);
   static final int KEY_LOC_SHIFT_R = 0;
   static final int KEY_LOC_SHIFT_L = 16;
@@ -75,9 +75,9 @@
   // The following methods are all called from the RFB thread
 
   public CConn(VncViewer viewer_, Socket sock_,
-               String vncServerName) 
+               String vncServerName)
   {
-    serverHost = null; serverPort = 0; sock = sock_; viewer = viewer_; 
+    serverHost = null; serverPort = 0; sock = sock_; viewer = viewer_;
     pendingPFChange = false;
     currentEncoding = Encodings.encodingTight; lastServerEncoding = -1;
     fullColour = viewer.fullColour.getValue();
@@ -188,7 +188,7 @@
     String title = ("VNC Authentication ["
                     +csecurity.description() + "]");
     String passwordFileStr = viewer.passwordFile.getValue();
-    PasswdDialog dlg;    
+    PasswdDialog dlg;
 
     if (user == null && passwordFileStr != "") {
       InputStream fp = null;
@@ -217,7 +217,7 @@
          user.append((String)System.getProperties().get("user.name"));
          return true;
       }
-      dlg = new PasswdDialog(title, viewer.sendLocalUsername.getValue(), 
+      dlg = new PasswdDialog(title, viewer.sendLocalUsername.getValue(),
          (passwd == null));
     }
     if (!dlg.showDialog()) return false;
@@ -242,7 +242,7 @@
     super.serverInit();
 
     // If using AutoSelect with old servers, start in FullColor
-    // mode. See comment in autoSelectFormatAndEncoding. 
+    // mode. See comment in autoSelectFormatAndEncoding.
     if (cp.beforeVersion(3, 8) && autoSelect)
       fullColour = true;
 
@@ -305,7 +305,7 @@
   // setName() is called when the desktop name changes
   public void setName(String name) {
     super.setName(name);
-  
+
     if (viewport != null) {
       viewport.setTitle(name+" - TigerVNC");
     }
@@ -314,8 +314,8 @@
   // framebufferUpdateStart() is called at the beginning of an update.
   // Here we try to send out a new framebuffer update request so that the
   // next update can be sent out in parallel with us decoding the current
-  // one. 
-  public void framebufferUpdateStart() 
+  // one.
+  public void framebufferUpdateStart()
   {
     // Note: This might not be true if sync fences are supported
     pendingUpdate = false;
@@ -327,14 +327,14 @@
   // For each rectangle, the FdInStream will have timed the speed
   // of the connection, allowing us to select format and encoding
   // appropriately, and then request another incremental update.
-  public void framebufferUpdateEnd() 
+  public void framebufferUpdateEnd()
   {
 
     desktop.updateWindow();
 
     if (firstUpdate) {
       int width, height;
-      
+
       // We need fences to make extra update requests and continuous
       // updates "safe". See fence() for the next step.
       if (cp.supportsFence)
@@ -354,9 +354,9 @@
         else if (layout.num_screens() != 1) {
 
           while (true) {
-            Iterator<Screen> iter = layout.screens.iterator(); 
+            Iterator<Screen> iter = layout.screens.iterator();
             Screen screen = (Screen)iter.next();
-        
+
             if (!iter.hasNext())
               break;
 
@@ -395,9 +395,9 @@
     desktop.setColourMapEntries(firstColour, nColours, rgbs);
   }
 
-  public void bell() { 
+  public void bell() {
     if (viewer.acceptBell.getValue())
-      desktop.getToolkit().beep(); 
+      desktop.getToolkit().beep();
   }
 
   public void serverCutText(String str, int len) {
@@ -484,7 +484,7 @@
       return;
     if ((desktop.width() == cp.width) && (desktop.height() == cp.height))
       return;
-    
+
     desktop.resize();
     recreateViewport();
   }
@@ -580,14 +580,14 @@
     // Check that we have a decent bandwidth measurement
     if ((kbitsPerSecond == 0) || (timeWaited < 100))
       return;
-  
+
     // Select appropriate quality level
     if (!cp.noJpeg) {
       if (kbitsPerSecond > 16000)
         newQualityLevel = 8;
       else
         newQualityLevel = 6;
-  
+
       if (newQualityLevel != cp.qualityLevel) {
         vlog.info("Throughput "+kbitsPerSecond+
                   " kbit/s - changing to quality "+newQualityLevel);
@@ -607,17 +607,17 @@
       // old servers.
       return;
     }
-    
+
     // Select best color level
     newFullColour = (kbitsPerSecond > 256);
     if (newFullColour != fullColour) {
       vlog.info("Throughput "+kbitsPerSecond+
-                " kbit/s - full color is now "+ 
+                " kbit/s - full color is now "+
   	            (newFullColour ? "enabled" : "disabled"));
       fullColour = newFullColour;
       formatChange = true;
       forceNonincremental = true;
-    } 
+    }
   }
 
   // requestNewUpdate() requests an update from the server, having set the
@@ -721,10 +721,10 @@
     Window fullScreenWindow = Viewport.getFullScreenWindow();
     if (fullScreenWindow != null)
       Viewport.setFullScreenWindow(null);
-    String msg = 
+    String msg =
       String.format(VncViewer.aboutText, VncViewer.version, VncViewer.build,
                     VncViewer.buildDate, VncViewer.buildTime);
-    JOptionPane op = 
+    JOptionPane op =
       new JOptionPane(msg, JOptionPane.INFORMATION_MESSAGE,
                       JOptionPane.DEFAULT_OPTION, VncViewer.logoIcon);
     JDialog dlg = op.createDialog("About TigerVNC Viewer for Java");
@@ -748,7 +748,7 @@
                              "Line speed estimate: %d kbit/s%n"+
                              "Protocol version: %d.%d%n"+
                              "Security method: %s [%s]%n");
-    String msg = 
+    String msg =
       String.format(info, cp.name(),
                     sock.getPeerName(), sock.getPeerPort(),
                     cp.width, cp.height,
@@ -922,7 +922,7 @@
       options.scalingFactor.setSelectedItem("Auto");
     } else if(scaleString.equalsIgnoreCase("FixedRatio")) {
       options.scalingFactor.setSelectedItem("Fixed Aspect Ratio");
-    } else { 
+    } else {
       digit = Integer.parseInt(scaleString);
       if (digit >= 1 && digit <= 1000) {
         options.scalingFactor.setSelectedItem(digit+"%");
@@ -930,7 +930,7 @@
         digit = Integer.parseInt(viewer.scalingFactor.getDefaultStr());
         options.scalingFactor.setSelectedItem(digit+"%");
       }
-      int scaleFactor = 
+      int scaleFactor =
         Integer.parseInt(scaleString.substring(0, scaleString.length()));
       if (desktop != null)
         desktop.setScaledSize();
@@ -967,7 +967,7 @@
       cp.customCompressLevel = viewer.customCompressLevel.getValue();
       encodingChange = true;
     }
-    if (Integer.parseInt(options.compressLevel.getSelectedItem().toString()) >= 0 && 
+    if (Integer.parseInt(options.compressLevel.getSelectedItem().toString()) >= 0 &&
         Integer.parseInt(options.compressLevel.getSelectedItem().toString()) <= 9) {
       viewer.compressLevel.setParam(options.compressLevel.getSelectedItem().toString());
     } else {
@@ -1059,7 +1059,7 @@
         Security.DisableSecType(Security.secTypeTLSPlain);
         Security.DisableSecType(Security.secTypeTLSIdent);
       }
-  
+
       /* Process security types which use X509 encryption */
       if (options.encX509.isSelected()) {
         if (options.secNone.isSelected())
@@ -1076,7 +1076,7 @@
         Security.DisableSecType(Security.secTypeX509Plain);
         Security.DisableSecType(Security.secTypeX509Ident);
       }
-  
+
       /* Process *None security types */
       if (options.secNone.isSelected()) {
         if (options.encNone.isSelected())
@@ -1090,7 +1090,7 @@
         Security.DisableSecType(Security.secTypeTLSNone);
         Security.DisableSecType(Security.secTypeX509None);
       }
-  
+
       /* Process *Vnc security types */
       if (options.secVnc.isSelected()) {
         if (options.encNone.isSelected())
@@ -1104,7 +1104,7 @@
         Security.DisableSecType(Security.secTypeTLSVnc);
         Security.DisableSecType(Security.secTypeX509Vnc);
       }
-  
+
       /* Process *Plain security types */
       if (options.secPlain.isSelected()) {
         if (options.encNone.isSelected())
@@ -1118,7 +1118,7 @@
         Security.DisableSecType(Security.secTypeTLSPlain);
         Security.DisableSecType(Security.secTypeX509Plain);
       }
-  
+
       /* Process *Ident security types */
       if (options.secIdent.isSelected()) {
         if (options.encNone.isSelected())
@@ -1542,7 +1542,7 @@
 
   // reading and writing int and boolean is atomic in java, so no
   // synchronization of the following flags is needed:
-  
+
   int lowColourLevel;
 
 
@@ -1589,6 +1589,6 @@
   private boolean fullColour;
   private boolean autoSelect;
   boolean fullScreen;
-  
+
   static LogWriter vlog = new LogWriter("CConn");
 }
diff --git a/java/com/tigervnc/vncviewer/ClipboardDialog.java b/java/com/tigervnc/vncviewer/ClipboardDialog.java
index 41f92b1..d6e2525 100644
--- a/java/com/tigervnc/vncviewer/ClipboardDialog.java
+++ b/java/com/tigervnc/vncviewer/ClipboardDialog.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -61,7 +61,7 @@
     textArea.setText(current);
     textArea.selectAll();
   }
-  
+
   public void setContents(String str) {
     current = str;
     textArea.setText(str);
@@ -69,7 +69,7 @@
   }
 
   public void serverCutText(String str, int len) {
-    setContents(str);    
+    setContents(str);
     SecurityManager sm = System.getSecurityManager();
     try {
       if (sm != null) sm.checkSystemClipboardAccess();
diff --git a/java/com/tigervnc/vncviewer/DesktopWindow.java b/java/com/tigervnc/vncviewer/DesktopWindow.java
index 7621af5..3657b03 100644
--- a/java/com/tigervnc/vncviewer/DesktopWindow.java
+++ b/java/com/tigervnc/vncviewer/DesktopWindow.java
@@ -70,7 +70,7 @@
     cursorBacking = new ManagedPixelBuffer();
     Dimension bestSize = tk.getBestCursorSize(16, 16);
     BufferedImage cursorImage;
-    cursorImage = new BufferedImage(bestSize.width, bestSize.height, 
+    cursorImage = new BufferedImage(bestSize.width, bestSize.height,
                                     BufferedImage.TYPE_INT_ARGB);
     java.awt.Point hotspot = new java.awt.Point(0,0);
     nullCursor = tk.createCustomCursor(cursorImage, hotspot, "nullCursor");
@@ -153,12 +153,12 @@
     int ch = (int)Math.floor((float)cursor.height() * scaleHeightRatio);
     Dimension bestSize = tk.getBestCursorSize(cw, ch);
     MemoryImageSource cursorSrc;
-    cursorSrc = new MemoryImageSource(cursor.width(), cursor.height(), 
+    cursorSrc = new MemoryImageSource(cursor.width(), cursor.height(),
                                       ColorModel.getRGBdefault(),
                                       cursor.data, 0, cursor.width());
     Image srcImage = tk.createImage(cursorSrc);
     BufferedImage cursorImage;
-    cursorImage = new BufferedImage(bestSize.width, bestSize.height, 
+    cursorImage = new BufferedImage(bestSize.width, bestSize.height,
                                     BufferedImage.TYPE_INT_ARGB);
     Graphics2D g2 = cursorImage.createGraphics();
     g2.setRenderingHint(RenderingHints.KEY_RENDERING,
@@ -313,9 +313,9 @@
     if (!scaleString.equalsIgnoreCase("Auto") &&
         !scaleString.equalsIgnoreCase("FixedRatio")) {
       int scalingFactor = Integer.parseInt(scaleString);
-      scaledWidth = 
+      scaledWidth =
         (int)Math.floor((float)cc.cp.width * (float)scalingFactor/100.0);
-      scaledHeight = 
+      scaledHeight =
         (int)Math.floor((float)cc.cp.height * (float)scalingFactor/100.0);
     } else {
       if (cc.viewport == null) {
@@ -324,7 +324,7 @@
       } else {
         Dimension vpSize = cc.viewport.getSize();
         Insets vpInsets = cc.viewport.getInsets();
-        Dimension availableSize = 
+        Dimension availableSize =
           new Dimension(vpSize.width - vpInsets.left - vpInsets.right,
                         vpSize.height - vpInsets.top - vpInsets.bottom);
         if (availableSize.width == 0 || availableSize.height == 0)
diff --git a/java/com/tigervnc/vncviewer/Dialog.java b/java/com/tigervnc/vncviewer/Dialog.java
index 19e38e4..4130123 100644
--- a/java/com/tigervnc/vncviewer/Dialog.java
+++ b/java/com/tigervnc/vncviewer/Dialog.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011-2013 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -83,10 +83,10 @@
   }
 
   public void addGBComponent(JComponent c, JComponent cp,
-                             int gx, int gy, 
-                             int gw, int gh, 
+                             int gx, int gy,
+                             int gw, int gh,
                              int gipx, int gipy,
-                             double gwx, double gwy, 
+                             double gwx, double gwy,
                              int fill, int anchor,
                              Insets insets)
   {
diff --git a/java/com/tigervnc/vncviewer/F8Menu.java b/java/com/tigervnc/vncviewer/F8Menu.java
index 54a4253..543f740 100644
--- a/java/com/tigervnc/vncviewer/F8Menu.java
+++ b/java/com/tigervnc/vncviewer/F8Menu.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/vncviewer/FileUtils.java b/java/com/tigervnc/vncviewer/FileUtils.java
index e7f3c5a..af5da3c 100644
--- a/java/com/tigervnc/vncviewer/FileUtils.java
+++ b/java/com/tigervnc/vncviewer/FileUtils.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/vncviewer/MenuKey.java b/java/com/tigervnc/vncviewer/MenuKey.java
index 5fdd037..63b6380 100644
--- a/java/com/tigervnc/vncviewer/MenuKey.java
+++ b/java/com/tigervnc/vncviewer/MenuKey.java
@@ -1,17 +1,17 @@
 /* Copyright 2011 Martin Koegler <mkoegler@auto.tuwien.ac.at>
  * Copyright 2011 Pierre Ossman <ossman@cendio.se> for Cendio AB
  * Copyright 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
@@ -24,7 +24,7 @@
 
 import com.tigervnc.rfb.*;
 
-public class MenuKey 
+public class MenuKey
 {
   static class MenuKeySymbol {
     public MenuKeySymbol(String name_, int keycode_, int keysym_) {
@@ -52,7 +52,7 @@
     new MenuKeySymbol("F12", KeyEvent.VK_F12, Keysyms.F12),
     new MenuKeySymbol("Pause", KeyEvent.VK_PAUSE, Keysyms.Pause),
     new MenuKeySymbol("Print", KeyEvent.VK_PRINTSCREEN, Keysyms.Print),
-    new MenuKeySymbol("Scroll_Lock", KeyEvent.VK_SCROLL_LOCK, 
+    new MenuKeySymbol("Scroll_Lock", KeyEvent.VK_SCROLL_LOCK,
                       Keysyms.Scroll_Lock),
     new MenuKeySymbol("Escape", KeyEvent.VK_ESCAPE, Keysyms.Escape),
     new MenuKeySymbol("Insert", KeyEvent.VK_INSERT, Keysyms.Insert),
@@ -61,11 +61,11 @@
     new MenuKeySymbol("Page_Up", KeyEvent.VK_PAGE_UP, Keysyms.Page_Up),
     new MenuKeySymbol("Page_Down", KeyEvent.VK_PAGE_DOWN, Keysyms.Page_Down)
   };
-  
+
   static int getMenuKeySymbolCount() {
     return menuSymbols.length;
   }
-  
+
   public static MenuKeySymbol[] getMenuKeySymbols() {
     return menuSymbols;
   }
@@ -79,30 +79,30 @@
     }
     return s;
   }
-  
+
   static int getMenuKeyCode() {
     int menuKeyCode = KeyEvent.VK_F8;
-  
+
     @SuppressWarnings({"static"})
-    String menuKeyStr = 
+    String menuKeyStr =
       Configuration.global().getParam("menuKey").getValueStr();
     for(int i = 0; i < getMenuKeySymbolCount(); i++)
       if (menuSymbols[i].name.equals(menuKeyStr))
         menuKeyCode = menuSymbols[i].keycode;
-  
+
     return menuKeyCode;
   }
 
   static int getMenuKeySym() {
     int menuKeySym = Keysyms.F8;
-  
+
     @SuppressWarnings({"static"})
-    String menuKeyStr = 
+    String menuKeyStr =
       Configuration.global().getParam("menuKey").getValueStr();
     for(int i = 0; i < getMenuKeySymbolCount(); i++)
       if (menuSymbols[i].name.equals(menuKeyStr))
         menuKeySym = menuSymbols[i].keysym;
-  
+
     return menuKeySym;
   }
 
diff --git a/java/com/tigervnc/vncviewer/OptionsDialog.java b/java/com/tigervnc/vncviewer/OptionsDialog.java
index e78563e..3d73d4c 100644
--- a/java/com/tigervnc/vncviewer/OptionsDialog.java
+++ b/java/com/tigervnc/vncviewer/OptionsDialog.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011-2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -53,7 +53,7 @@
   JButton cfLoadButton, cfSaveAsButton, defSaveButton, defReloadButton, defClearButton;
 
   @SuppressWarnings({"rawtypes","unchecked"})
-  public OptionsDialog(OptionsDialogCallback cb_) { 
+  public OptionsDialog(OptionsDialogCallback cb_) {
     super(true);
     cb = cb_;
     setResizable(false);
@@ -61,7 +61,7 @@
 
     getContentPane().setLayout(
       new BoxLayout(getContentPane(), BoxLayout.PAGE_AXIS));
-	
+
     JTabbedPane tabPane = new JTabbedPane();
 
     ButtonGroup encodingGroup = new ButtonGroup();
@@ -133,7 +133,7 @@
     sendClipboard = new JCheckBox("Send clipboard to server");
     sendClipboard.addItemListener(this);
     JLabel menuKeyLabel = new JLabel("Menu Key");
-    String[] menuKeys = new String[MenuKey.getMenuKeySymbolCount()]; 
+    String[] menuKeys = new String[MenuKey.getMenuKeySymbolCount()];
     for (int i = 0; i < MenuKey.getMenuKeySymbolCount(); i++)
       menuKeys[i] = KeyEvent.getKeyText(MenuKey.getMenuKeySymbols()[i].keycode);
     menuKey  = new JComboBox(menuKeys);
@@ -156,8 +156,8 @@
     acceptBell = new JCheckBox("Beep when requested by the server");
     acceptBell.addItemListener(this);
     JLabel scalingFactorLabel = new JLabel("Scaling Factor");
-    Object[] scalingFactors = { 
-      "Auto", "Fixed Aspect Ratio", "50%", "75%", "95%", "100%", "105%", 
+    Object[] scalingFactors = {
+      "Auto", "Fixed Aspect Ratio", "50%", "75%", "95%", "100%", "105%",
       "125%", "150%", "175%", "200%", "250%", "300%", "350%", "400%" };
     scalingFactor = new JComboBox(scalingFactors);
     // Hack to set the left inset on editable JComboBox
@@ -167,7 +167,7 @@
     } else if (UIManager.getLookAndFeel().getID() == "Metal") {
       ComboBoxEditor sfe = scalingFactor.getEditor();
       JTextField sfeTextField = (JTextField)sfe.getEditorComponent();
-      sfeTextField.setBorder(new CompoundBorder(sfeTextField.getBorder(), 
+      sfeTextField.setBorder(new CompoundBorder(sfeTextField.getBorder(),
                                                 new EmptyBorder(0,2,0,0)));
     }
     scalingFactor.setEditable(true);
@@ -274,7 +274,7 @@
     this.getContentPane().add(buttonPane);
 
     pack();
-	
+
   }
 
   public void initDialog() {
@@ -292,7 +292,7 @@
     sendLocalUsername.setEnabled(secVeNCrypt.isEnabled()&&
       (secPlain.isSelected()||secIdent.isSelected()));
   }
-  
+
   private void updatePreferences() {
     if (autoSelect.isSelected()) {
       UserPreferences.set("global", "AutoSelect", true);
@@ -338,7 +338,7 @@
       UserPreferences.set("global", "ScalingFactor", "Auto");
     } else if(scaleString.equalsIgnoreCase("Fixed Aspect Ratio")) {
       UserPreferences.set("global", "ScalingFactor", "FixedRatio");
-    } else { 
+    } else {
       scaleString=scaleString.substring(0, scaleString.length()-1);
       UserPreferences.set("global", "ScalingFactor", scaleString);
     }
@@ -411,7 +411,7 @@
         scalingFactor.setSelectedItem("Auto");
       } else if (scaleString.equalsIgnoreCase("FixedRatio")) {
         scalingFactor.setSelectedItem("Fixed Aspect Ratio");
-      } else { 
+      } else {
         scalingFactor.setSelectedItem(scaleString+"%");
       }
     }
@@ -466,7 +466,7 @@
     if (group != null)
       group.add(c);
     c.addItemListener(this);
-    
+
     return c;
   }
 
@@ -547,7 +547,7 @@
       mediumColour.setEnabled(!autoSelect.isSelected());
       lowColour.setEnabled(!autoSelect.isSelected());
       veryLowColour.setEnabled(!autoSelect.isSelected());
-    } 
+    }
     if (s instanceof JCheckBox && (JCheckBox)s == customCompressLevel) {
       compressLevel.setEnabled(customCompressLevel.isSelected());
     }
diff --git a/java/com/tigervnc/vncviewer/OptionsDialogCallback.java b/java/com/tigervnc/vncviewer/OptionsDialogCallback.java
index 297daed..efb8c06 100644
--- a/java/com/tigervnc/vncviewer/OptionsDialogCallback.java
+++ b/java/com/tigervnc/vncviewer/OptionsDialogCallback.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/vncviewer/PasswdDialog.java b/java/com/tigervnc/vncviewer/PasswdDialog.java
index 10281e0..edd9554 100644
--- a/java/com/tigervnc/vncviewer/PasswdDialog.java
+++ b/java/com/tigervnc/vncviewer/PasswdDialog.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011-2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -86,7 +86,7 @@
     }
   }
 
-  public String getPassword() { 
+  public String getPassword() {
     return new String(passwdEntry.getPassword());
   }
   public String getPassphrase(){ return null; }
@@ -103,10 +103,10 @@
   }
   public boolean promptYesNo(String str){
     Object[] options={ "yes", "no" };
-    int foo=JOptionPane.showOptionDialog(null, 
+    int foo=JOptionPane.showOptionDialog(null,
            str,
-           "Warning", 
-           JOptionPane.DEFAULT_OPTION, 
+           "Warning",
+           JOptionPane.DEFAULT_OPTION,
            JOptionPane.WARNING_MESSAGE,
            null, options, options[0]);
      return foo==0;
@@ -119,7 +119,7 @@
     Container panel = new JPanel();
     panel.setLayout(new GridBagLayout());
 
-    GridBagConstraints gbc = 
+    GridBagConstraints gbc =
       new GridBagConstraints(0,0,1,1,1,1,
                              GridBagConstraints.NORTHWEST,
                              GridBagConstraints.NONE,
@@ -152,7 +152,7 @@
       gbc.gridy++;
     }
 
-    if(JOptionPane.showConfirmDialog(null, panel, 
+    if(JOptionPane.showConfirmDialog(null, panel,
                                      destination+": "+name,
                                      JOptionPane.OK_CANCEL_OPTION,
                                      JOptionPane.QUESTION_MESSAGE)
diff --git a/java/com/tigervnc/vncviewer/PlatformPixelBuffer.java b/java/com/tigervnc/vncviewer/PlatformPixelBuffer.java
index b14924d..e0e24f0 100644
--- a/java/com/tigervnc/vncviewer/PlatformPixelBuffer.java
+++ b/java/com/tigervnc/vncviewer/PlatformPixelBuffer.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011-2012 Brian P.Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/vncviewer/ServerDialog.java b/java/com/tigervnc/vncviewer/ServerDialog.java
index ae0793e..7b8ee0c 100644
--- a/java/com/tigervnc/vncviewer/ServerDialog.java
+++ b/java/com/tigervnc/vncviewer/ServerDialog.java
@@ -1,16 +1,16 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011-2013 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -35,7 +35,7 @@
   @SuppressWarnings({"unchecked","rawtypes"})
   public ServerDialog(OptionsDialog options_,
                       String defaultServerName, CConn cc_) {
-    
+
     super(true);
     cc = cc_;
     setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
@@ -123,7 +123,7 @@
     aboutButton.addActionListener(this);
     okButton.addActionListener(this);
     cancelButton.addActionListener(this);
-    
+
     pack();
   }
 
@@ -177,7 +177,7 @@
     UserPreferences.save("ServerDialog");
     endDialog();
   }
-  
+
   CConn cc;
   @SuppressWarnings("rawtypes")
   JComboBox server;
diff --git a/java/com/tigervnc/vncviewer/UserPreferences.java b/java/com/tigervnc/vncviewer/UserPreferences.java
index 95c56fb..544774d 100644
--- a/java/com/tigervnc/vncviewer/UserPreferences.java
+++ b/java/com/tigervnc/vncviewer/UserPreferences.java
@@ -1,15 +1,15 @@
 /* Copyright (C) 2012 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
diff --git a/java/com/tigervnc/vncviewer/Viewport.java b/java/com/tigervnc/vncviewer/Viewport.java
index 465dee8..66ac131 100644
--- a/java/com/tigervnc/vncviewer/Viewport.java
+++ b/java/com/tigervnc/vncviewer/Viewport.java
@@ -1,17 +1,17 @@
 /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
  * Copyright (C) 2011-2013 Brian P. Hinz
  * Copyright (C) 2012 D. R. Commander.  All Rights Reserved.
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -41,7 +41,7 @@
     setFocusable(false);
     setFocusTraversalKeysEnabled(false);
     setIconImage(VncViewer.frameIcon);
-    UIManager.getDefaults().put("ScrollPane.ancestorInputMap", 
+    UIManager.getDefaults().put("ScrollPane.ancestorInputMap",
       new UIDefaults.LazyInputMap(new Object[]{}));
     sp = new JScrollPane();
     sp.getViewport().setBackground(Color.BLACK);
@@ -93,7 +93,7 @@
         }
         if (cc.desktop.cursor != null) {
           Cursor cursor = cc.desktop.cursor;
-          cc.setCursor(cursor.width(),cursor.height(),cursor.hotspot, 
+          cc.setCursor(cursor.width(),cursor.height(),cursor.hotspot,
                        cursor.data, cursor.mask);
         }
       }
diff --git a/java/com/tigervnc/vncviewer/VncViewer.java b/java/com/tigervnc/vncviewer/VncViewer.java
index 90abea0..c783bef 100644
--- a/java/com/tigervnc/vncviewer/VncViewer.java
+++ b/java/com/tigervnc/vncviewer/VncViewer.java
@@ -2,17 +2,17 @@
  * Copyright 2011 Pierre Ossman <ossman@cendio.se> for Cendio AB
  * Copyright (C) 2011 D. R. Commander.  All Rights Reserved.
  * Copyright (C) 2011-2013 Brian P. Hinz
- * 
+ *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this software; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
@@ -55,18 +55,18 @@
                                                     "Built on %s at %s%n"+
                                                     "Copyright (C) 1999-2012 TigerVNC Team and many others (see README.txt)%n"+
                                                     "See http://www.tigervnc.org for information on TigerVNC.");
-                                           
+
   public static String version = null;
   public static String build = null;
   public static String buildDate = null;
   public static String buildTime = null;
-  static ImageIcon frameIconSrc = 
+  static ImageIcon frameIconSrc =
     new ImageIcon(VncViewer.class.getResource("tigervnc.ico"));
   public static final Image frameIcon = frameIconSrc.getImage();
-  public static final ImageIcon logoIcon = 
+  public static final ImageIcon logoIcon =
     new ImageIcon(VncViewer.class.getResource("tigervnc.png"));
   public static final Image logoImage = logoIcon.getImage();
-  public static final InputStream timestamp = 
+  public static final InputStream timestamp =
     VncViewer.class.getResourceAsStream("timestamp");
 
   public static void setLookAndFeel() {
@@ -107,7 +107,7 @@
         FontUIResource r = new FontUIResource(name, style, size);
       	UIManager.put("TitledBorder.font", r);
       }
-    } catch (java.lang.Exception e) { 
+    } catch (java.lang.Exception e) {
       vlog.info(e.toString());
     }
   }
@@ -118,7 +118,7 @@
     viewer.start();
   }
 
-  
+
   public VncViewer(String[] argv) {
     applet = false;
 
@@ -126,11 +126,11 @@
     UserPreferences.load("global");
 
     SecurityClient.setDefaults();
-    
+
     // Write about text to console, still using normal locale codeset
     getTimestamp();
     System.err.format("%n");
-    System.err.format(aboutText, version, build, buildDate, buildTime); 
+    System.err.format(aboutText, version, build, buildDate, buildTime);
     System.err.format("%n");
 
     Configuration.enableViewerParams();
@@ -338,7 +338,7 @@
   public void paint(Graphics g) {
     g.drawImage(logoImage, 0, 0, this);
     int h = logoImage.getHeight(this)+20;
-    g.drawString(String.format(aboutText, version, build, 
+    g.drawString(String.format(aboutText, version, build,
                                buildDate, buildTime), 0, h);
   }
 
@@ -348,7 +348,7 @@
     if (listenMode.getValue()) {
       int port = 5500;
 
-      if (vncServerName.getValue() != null && 
+      if (vncServerName.getValue() != null &&
           Character.isDigit(vncServerName.getValue().charAt(0)))
         port = Integer.parseInt(vncServerName.getValue());
 
@@ -378,7 +378,7 @@
         vlog.info(e.getMessage());
       } else if (cc == null || !cc.shuttingDown) {
         e.printStackTrace();
-        JOptionPane op = 
+        JOptionPane op =
           new JOptionPane(e.getMessage(), JOptionPane.WARNING_MESSAGE);
         JDialog dlg = op.createDialog("TigerVNC Viewer");
         dlg.setIconImage(frameIcon);
@@ -427,7 +427,7 @@
   = new IntParameter("LowColorLevel",
                      "Color level to use on slow connections. "+
                      "0 = Very Low (8 colors), 1 = Low (64 colors), "+
-                     "2 = Medium (256 colors)", 
+                     "2 = Medium (256 colors)",
                      2);
   AliasParameter lowColourLevelAlias
   = new AliasParameter("LowColourLevel",
@@ -470,7 +470,7 @@
                         "connect (if possible)", "");
   BoolParameter listenMode
   = new BoolParameter("listen",
-                      "Listen for connections from VNC servers", 
+                      "Listen for connections from VNC servers",
                       false);
   StringParameter scalingFactor
   = new StringParameter("ScalingFactor",
@@ -503,7 +503,7 @@
                      0);
   BoolParameter acceptBell
   = new BoolParameter("AcceptBell",
-                      "Produce a system beep when requested to by the server.", 
+                      "Produce a system beep when requested to by the server.",
                       true);
   StringParameter via
   = new StringParameter("via",
diff --git a/java/com/tigervnc/vncviewer/tunnel.java b/java/com/tigervnc/vncviewer/tunnel.java
index a66d83a..6d55fec 100644
--- a/java/com/tigervnc/vncviewer/tunnel.java
+++ b/java/com/tigervnc/vncviewer/tunnel.java
@@ -37,32 +37,32 @@
 import com.jcraft.jsch.JSch;
 import com.jcraft.jsch.Session;
 
-public class tunnel 
+public class tunnel
 {
   private final static Integer SERVER_PORT_OFFSET = 5900;;
   private final static String DEFAULT_SSH_CMD = "/usr/bin/ssh";
-  private final static String DEFAULT_TUNNEL_CMD  
+  private final static String DEFAULT_TUNNEL_CMD
     = DEFAULT_SSH_CMD+" -f -L %L:localhost:%R %H sleep 20";
-  private final static String DEFAULT_VIA_CMD  
+  private final static String DEFAULT_VIA_CMD
     = DEFAULT_SSH_CMD+" -f -L %L:%H:%R %G sleep 20";
 
   private final static int H = 17;
   private final static int G = 16;
   private final static int R = 27;
   private final static int L = 21;
-  
+
   /* True if there was -tunnel or -via option in the command line. */
   private static boolean tunnelSpecified = false;
-  
+
   /* True if it was -tunnel, not -via option. */
   private static boolean tunnelOption = false;
-  
+
   /* "Hostname:display" pair in the command line will be substituted
      by this fake argument when tunneling is used. */
   private static String lastArgv;
 
   private static String tunnelEndpoint;
-  
+
   public static Boolean
   createTunnel(int pargc, String[] argv, int tunnelArgIndex)
   {
@@ -74,19 +74,19 @@
     char[] remotePortStr = new char[8];
     StringBuilder gatewayHost = new StringBuilder("");
     StringBuilder remoteHost = new StringBuilder("localhost");
-  
+
     tunnelSpecified = true;
     if (argv[tunnelArgIndex].equalsIgnoreCase("-tunnel"))
       tunnelOption = true;
-  
+
     pattern = getCmdPattern();
     if (pattern == null)
       return false;
-  
+
     localPort[0] = TcpSocket.findFreeTcpPort();
     if (localPort[0] == 0)
       return false;
-  
+
     if (tunnelOption) {
       processTunnelArgs(remoteHost, remotePort, localPort,
   		      pargc, argv, tunnelArgIndex);
@@ -94,50 +94,50 @@
       processViaArgs(gatewayHost, remoteHost, remotePort, localPort,
   		   pargc, argv, tunnelArgIndex);
     }
-  
+
     localPortStr = Integer.toString(localPort[0]).toCharArray();
     remotePortStr = Integer.toString(remotePort[0]).toCharArray();
-  
-    if (!fillCmdPattern(cmd, pattern, gatewayHost.toString().toCharArray(), 
+
+    if (!fillCmdPattern(cmd, pattern, gatewayHost.toString().toCharArray(),
 		remoteHost.toString().toCharArray(), remotePortStr, localPortStr))
       return false;
-  
+
     if (!runCommand(new String(cmd)))
       return false;
-  
+
     return true;
   }
-  
+
   private static void
-  processTunnelArgs(StringBuilder remoteHost, int[] remotePort, 
-                    int[] localPort, int pargc, String[] argv, 
+  processTunnelArgs(StringBuilder remoteHost, int[] remotePort,
+                    int[] localPort, int pargc, String[] argv,
                     int tunnelArgIndex)
   {
     String pdisplay;
-  
+
     if (tunnelArgIndex >= pargc - 1)
       VncViewer.usage();
-  
+
     pdisplay = argv[pargc - 1].split(":")[1];
     if (pdisplay == null || pdisplay == argv[pargc - 1])
       VncViewer.usage();
-  
+
     if (pdisplay.matches("/[^0-9]/"))
       VncViewer.usage();
-  
+
     remotePort[0] = Integer.parseInt(pdisplay);
     if (remotePort[0] < 100)
       remotePort[0] = remotePort[0] + SERVER_PORT_OFFSET;
-  
+
     lastArgv = new String("localhost::"+localPort[0]);
-  
+
     remoteHost.setLength(0);
     remoteHost.insert(0, argv[pargc - 1].split(":")[0]);
     argv[pargc - 1] = lastArgv;
-  
+
     //removeArgs(pargc, argv, tunnelArgIndex, 1);
   }
-  
+
   private static void
   processViaArgs(StringBuilder gatewayHost, StringBuilder remoteHost,
   	       int[] remotePort, int[] localPort,
@@ -146,10 +146,10 @@
     String colonPos;
     int len, portOffset;
     int disp;
-  
+
     if (tunnelArgIndex >= pargc - 2)
       VncViewer.usage();
-  
+
     colonPos = argv[pargc - 1].split(":", 2)[1];
     if (colonPos == null) {
       /* No colon -- use default port number */
@@ -171,44 +171,44 @@
         portOffset = 0;
       remotePort[0] = disp + portOffset;
     }
-  
+
     lastArgv = "localhost::"+localPort[0];
-  
+
     gatewayHost.setLength(0);
     gatewayHost.insert(0, argv[tunnelArgIndex + 1]);
-  
+
     if (!argv[pargc - 1].split(":", 2)[0].equals("")) {
       remoteHost.setLength(0);
       remoteHost.insert(0, argv[pargc - 1].split(":", 2)[0]);
     }
-  
+
     argv[pargc - 1] = lastArgv;
-  
+
     //removeArgs(pargc, argv, tunnelArgIndex, 2);
   }
-  
+
   private static char[]
   getCmdPattern()
   {
     String pattern = "";
-  
+
     try {
       if (tunnelOption) {
         pattern = System.getProperty("VNC_TUNNEL_CMD");
       } else {
         pattern = System.getProperty("VNC_VIA_CMD");
       }
-    } catch (java.lang.Exception e) { 
+    } catch (java.lang.Exception e) {
       vlog.info(e.toString());
     }
     if (pattern == null || pattern.equals(""))
       pattern = (tunnelOption) ? DEFAULT_TUNNEL_CMD : DEFAULT_VIA_CMD;
-  
+
     return pattern.toCharArray();
   }
-  
+
   /* Note: in fillCmdPattern() result points to a 1024-byte buffer */
-  
+
   private static boolean
   fillCmdPattern(char[] result, char[] pattern,
   	       char[] gatewayHost, char[] remoteHost,
@@ -249,12 +249,12 @@
       }
       result[j] = pattern[i];
     }
-  
+
     if (pattern.length > 1024) {
       vlog.error("Tunneling command is too long.");
       return false;
     }
-  
+
     if (!H_found || !R_found || !L_found) {
       vlog.error("%H, %R or %L absent in tunneling command.");
       return false;
@@ -263,10 +263,10 @@
       vlog.error("%G pattern absent in tunneling command.");
       return false;
     }
-  
+
     return true;
   }
-  
+
   private static Boolean
   runCommand(String cmd)
   {
@@ -322,6 +322,6 @@
     }
     return true;
   }
-  
+
   static LogWriter vlog = new LogWriter("tunnel");
 }