Mercurial > hg > Members > nobuyasu > tightVNCProxy
changeset 83:d4236fd2efe1
too much memory
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 03 Aug 2011 04:47:10 +0900 |
parents | 0cbe556e2c54 |
children | 704e01d2390c |
files | src/myVncProxy/MyRfbProto.java |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/myVncProxy/MyRfbProto.java Wed Aug 03 04:26:58 2011 +0900 +++ b/src/myVncProxy/MyRfbProto.java Wed Aug 03 04:47:10 2011 +0900 @@ -32,7 +32,7 @@ * CheckMillis is one of new msgType for RFB 3.998. */ final static int SpeedCheckMillis = 4; - private static final int INFLATE_BUFSIZE = 1024*1024; + private static final int INFLATE_BUFSIZE = 1024*100; boolean printStatusFlag = false; long startCheckTime; @@ -376,7 +376,7 @@ readFully(b); if (b[0]==RfbProto.FramebufferUpdate) { - int encoding = ((b[12]*256+b[13])*256+b[14])*256+b[15]; + int encoding = ((b[12]<<8+b[13])<<8+b[14])<<8+b[15]; if (encoding==RfbProto.EncodingZlib||encoding==RfbProto.EncodingZRLE) { int len; inflater.setInput(b, 20, b.length-20); @@ -555,12 +555,12 @@ for (;;) { byte[] b = c.poll(); if (b[0]==RfbProto.FramebufferUpdate) { - int encoding = ((b[12]*256+b[13])*256+b[14])*256+b[15]; + int encoding = ((b[12]<<8+b[13])<<8+b[14])<<8+b[15]; if (encoding==RfbProto.EncodingZlib||encoding==RfbProto.EncodingZRLE) { byte[] c1 = new byte[INFLATE_BUFSIZE]; int len=0,len1,clen; do { - clen = ((b[16]*256+b[17])*256+b[18])*256+b[19]; + clen = ((b[16]<<8+b[17])<<8+b[18])<<8+b[19]; deflater.setInput(b,20,clen); len1 = deflater.deflate(c1); if (clen==INFLATE_BUFSIZE) b = c.poll();