Mercurial > hg > Applications > TreeVNC
changeset 318:d01d56038dd1
try catch unzip inflate error.
author | oc |
---|---|
date | Thu, 29 Jan 2015 14:16:59 +0900 |
parents | 3c63bc88383e |
children | f2b835466a24 |
files | src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java |
diffstat | 2 files changed, 10 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Thu Jan 29 13:29:02 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Thu Jan 29 14:16:59 2015 +0900 @@ -603,8 +603,7 @@ * @throws IOException */ public int unzip(Inflater inflater, LinkedList<ByteBuffer> inputs, - int inputIndex, byte[] bytes, int bufSize) - throws DataFormatException { + int inputIndex, byte[] bytes, int bufSize) { int position = 0; int limit = bytes.length; while (inputIndex < inputs.size()) { @@ -614,13 +613,15 @@ // we need this // inflater.end(); but this won't work do { - int len0 = inflater.inflate(bytes, position, - limit-position); - if (len0 > 0) { - position += len0; - if (position > limit) { - throw new DataFormatException(); + int len0; + try { + len0 = inflater.inflate(bytes, position, limit-position); + if (len0 > 0) { + position += len0; + if (position > limit) throw new DataFormatException(); } + } catch (DataFormatException e) { + e.printStackTrace(); } } while (!inflater.needsInput()); } @@ -687,8 +688,6 @@ } else { multicastqueue.put(bufs); } - } catch (DataFormatException e) { - throw new TransportException(e); } catch (IOException e) { throw new TransportException(e); }
--- a/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java Thu Jan 29 13:29:02 2015 +0900 +++ b/src/viewer_swing/java/com/glavsoft/viewer/swing/Surface.java Thu Jan 29 14:16:59 2015 +0900 @@ -135,7 +135,7 @@ public void paintComponent(Graphics g) { if (null == renderer) return; ((Graphics2D)g).scale(scaleFactor, scaleFactor); - ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED); + ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); synchronized (renderer.getLock()) { Image offscreenImage = renderer.getOffscreenImage(); if (offscreenImage != null) {