Mercurial > 510Connectbot
changeset 327:9a657362519c ganymed
pickup compression from trilead
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 31 Jul 2014 11:18:21 -0700 |
parents | 97da8c5fb40a |
children | 459eb9b6b84e |
files | src/ch/ethz/ssh2/compression/CompressionFactory.java src/ch/ethz/ssh2/compression/Compressor.java src/ch/ethz/ssh2/compression/ICompressor.java src/ch/ethz/ssh2/compression/Zlib.java |
diffstat | 4 files changed, 35 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/compression/CompressionFactory.java Thu Jul 31 11:15:15 2014 -0700 +++ b/src/ch/ethz/ssh2/compression/CompressionFactory.java Thu Jul 31 11:18:21 2014 -0700 @@ -59,7 +59,7 @@ getEntry(compressorCandidates[i]); } - public static ICompressor createCompressor(String type) { + public static Compressor createCompressor(String type) { try { CompressorEntry ce = getEntry(type); @@ -67,7 +67,7 @@ return null; Class<?> cc = Class.forName(ce.compressorClass); - ICompressor cmp = (ICompressor) cc.newInstance(); + Compressor cmp = (Compressor) cc.newInstance(); return cmp; } catch (Exception e) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ch/ethz/ssh2/compression/Compressor.java Thu Jul 31 11:18:21 2014 -0700 @@ -0,0 +1,32 @@ +/* + * ConnectBot: simple, powerful, open-source SSH client for Android + * Copyright 2007 Kenny Root, Jeffrey Sharkey + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package ch.ethz.ssh2.compression; + +/** + * @author Kenny Root + * + */ +public interface Compressor { + int getBufferSize(); + + int compress(byte[] buf, int start, int len, byte[] output); + + byte[] uncompress(byte[] buf, int start, int[] len); + + boolean canCompressPreauth(); +}
--- a/src/ch/ethz/ssh2/compression/ICompressor.java Thu Jul 31 11:15:15 2014 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* - * ConnectBot: simple, powerful, open-source SSH client for Android - * Copyright 2007 Kenny Root, Jeffrey Sharkey - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ch.ethz.ssh2.compression; - -/** - * @author Kenny Root - * - */ -public interface ICompressor { - int getBufferSize(); - - int compress(byte[] buf, int start, int len, byte[] output); - - byte[] uncompress(byte[] buf, int start, int[] len); - - boolean canCompressPreauth(); -}
--- a/src/ch/ethz/ssh2/compression/Zlib.java Thu Jul 31 11:15:15 2014 -0700 +++ b/src/ch/ethz/ssh2/compression/Zlib.java Thu Jul 31 11:18:21 2014 -0700 @@ -24,7 +24,7 @@ * @author Kenny Root * */ -public class Zlib implements ICompressor { +public class Zlib implements Compressor { static private final int DEFAULT_BUF_SIZE = 4096; static private final int LEVEL = 5;