From 4ed357774aa94ad8be60ec9d257cc414462a0dc6 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Oct 2012 11:32:57 +0400 Subject: switch to junrar library --- .../junrar/unpack/decode/AudioVariables.java | 144 +++++++++++++++++++++ src/com/github/junrar/unpack/decode/BitDecode.java | 35 +++++ src/com/github/junrar/unpack/decode/CodeType.java | 29 +++++ src/com/github/junrar/unpack/decode/Compress.java | 45 +++++++ src/com/github/junrar/unpack/decode/Decode.java | 81 ++++++++++++ .../github/junrar/unpack/decode/DistDecode.java | 37 ++++++ .../github/junrar/unpack/decode/FilterType.java | 30 +++++ src/com/github/junrar/unpack/decode/LitDecode.java | 36 ++++++ .../github/junrar/unpack/decode/LowDistDecode.java | 37 ++++++ .../github/junrar/unpack/decode/MultDecode.java | 37 ++++++ src/com/github/junrar/unpack/decode/RepDecode.java | 36 ++++++ 11 files changed, 547 insertions(+) create mode 100644 src/com/github/junrar/unpack/decode/AudioVariables.java create mode 100644 src/com/github/junrar/unpack/decode/BitDecode.java create mode 100644 src/com/github/junrar/unpack/decode/CodeType.java create mode 100644 src/com/github/junrar/unpack/decode/Compress.java create mode 100644 src/com/github/junrar/unpack/decode/Decode.java create mode 100644 src/com/github/junrar/unpack/decode/DistDecode.java create mode 100644 src/com/github/junrar/unpack/decode/FilterType.java create mode 100644 src/com/github/junrar/unpack/decode/LitDecode.java create mode 100644 src/com/github/junrar/unpack/decode/LowDistDecode.java create mode 100644 src/com/github/junrar/unpack/decode/MultDecode.java create mode 100644 src/com/github/junrar/unpack/decode/RepDecode.java (limited to 'src/com/github/junrar/unpack/decode') diff --git a/src/com/github/junrar/unpack/decode/AudioVariables.java b/src/com/github/junrar/unpack/decode/AudioVariables.java new file mode 100644 index 0000000..7310663 --- /dev/null +++ b/src/com/github/junrar/unpack/decode/AudioVariables.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class AudioVariables { + int k1, k2, k3, k4, k5; + + int d1, d2, d3, d4; + + int lastDelta; + + int dif[] = new int[11]; + + int byteCount; + + int lastChar; + + public int getByteCount() { + return byteCount; + } + + public void setByteCount(int byteCount) { + this.byteCount = byteCount; + } + + public int getD1() { + return d1; + } + + public void setD1(int d1) { + this.d1 = d1; + } + + public int getD2() { + return d2; + } + + public void setD2(int d2) { + this.d2 = d2; + } + + public int getD3() { + return d3; + } + + public void setD3(int d3) { + this.d3 = d3; + } + + public int getD4() { + return d4; + } + + public void setD4(int d4) { + this.d4 = d4; + } + + public int[] getDif() { + return dif; + } + + public void setDif(int[] dif) { + this.dif = dif; + } + + public int getK1() { + return k1; + } + + public void setK1(int k1) { + this.k1 = k1; + } + + public int getK2() { + return k2; + } + + public void setK2(int k2) { + this.k2 = k2; + } + + public int getK3() { + return k3; + } + + public void setK3(int k3) { + this.k3 = k3; + } + + public int getK4() { + return k4; + } + + public void setK4(int k4) { + this.k4 = k4; + } + + public int getK5() { + return k5; + } + + public void setK5(int k5) { + this.k5 = k5; + } + + public int getLastChar() { + return lastChar; + } + + public void setLastChar(int lastChar) { + this.lastChar = lastChar; + } + + public int getLastDelta() { + return lastDelta; + } + + public void setLastDelta(int lastDelta) { + this.lastDelta = lastDelta; + } + + +} diff --git a/src/com/github/junrar/unpack/decode/BitDecode.java b/src/com/github/junrar/unpack/decode/BitDecode.java new file mode 100644 index 0000000..453d90a --- /dev/null +++ b/src/com/github/junrar/unpack/decode/BitDecode.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class BitDecode extends Decode +{ + /** + * + */ + public BitDecode() + { + decodeNum = new int[Compress.BC]; + } +} diff --git a/src/com/github/junrar/unpack/decode/CodeType.java b/src/com/github/junrar/unpack/decode/CodeType.java new file mode 100644 index 0000000..047dc0c --- /dev/null +++ b/src/com/github/junrar/unpack/decode/CodeType.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public enum CodeType { + CODE_HUFFMAN,CODE_LZ,CODE_LZ2,CODE_REPEATLZ,CODE_CACHELZ, + CODE_STARTFILE,CODE_ENDFILE,CODE_VM,CODE_VMDATA; +} diff --git a/src/com/github/junrar/unpack/decode/Compress.java b/src/com/github/junrar/unpack/decode/Compress.java new file mode 100644 index 0000000..12bf342 --- /dev/null +++ b/src/com/github/junrar/unpack/decode/Compress.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class Compress { + public static final int CODEBUFSIZE = 0x4000; + public static final int MAXWINSIZE = 0x400000; + public static final int MAXWINMASK = (MAXWINSIZE-1); + + public static final int LOW_DIST_REP_COUNT = 16; + + public static final int NC = 299; /* alphabet = {0, 1, 2, ..., NC - 1} */ + public static final int DC = 60; + public static final int LDC = 17; + public static final int RC = 28; + public static final int HUFF_TABLE_SIZE = (NC+DC+RC+LDC); + public static final int BC = 20; + + public static final int NC20 = 298; /* alphabet = {0, 1, 2, ..., NC - 1} */ + public static final int DC20 = 48; + public static final int RC20 = 28; + public static final int BC20 = 19; + public static final int MC20 = 257; +} diff --git a/src/com/github/junrar/unpack/decode/Decode.java b/src/com/github/junrar/unpack/decode/Decode.java new file mode 100644 index 0000000..2d1b9b6 --- /dev/null +++ b/src/com/github/junrar/unpack/decode/Decode.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * Used to store information for lz decoding + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class Decode +{ + private int maxNum; + + private final int[] decodeLen = new int[16]; + + private final int[] decodePos = new int[16]; + + protected int[] decodeNum = new int[2]; + + /** + * returns the decode Length array + * @return decodeLength + */ + public int[] getDecodeLen() + { + return decodeLen; + } + + /** + * returns the decode num array + * @return decodeNum + */ + public int[] getDecodeNum() + { + return decodeNum; + } + + /** + * returns the decodePos array + * @return decodePos + */ + public int[] getDecodePos() + { + return decodePos; + } + + /** + * returns the max num + * @return maxNum + */ + public int getMaxNum() + { + return maxNum; + } + + /** + * sets the max num + * @param maxNum to be set to maxNum + */ + public void setMaxNum(int maxNum) + { + this.maxNum = maxNum; + } + +} diff --git a/src/com/github/junrar/unpack/decode/DistDecode.java b/src/com/github/junrar/unpack/decode/DistDecode.java new file mode 100644 index 0000000..d52d767 --- /dev/null +++ b/src/com/github/junrar/unpack/decode/DistDecode.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class DistDecode extends Decode +{ + + /** + * + */ + public DistDecode() + { + decodeNum = new int[Compress.DC]; + } + +} diff --git a/src/com/github/junrar/unpack/decode/FilterType.java b/src/com/github/junrar/unpack/decode/FilterType.java new file mode 100644 index 0000000..d0cbfcc --- /dev/null +++ b/src/com/github/junrar/unpack/decode/FilterType.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public enum FilterType { + FILTER_NONE, FILTER_PPM /*dummy*/, FILTER_E8, FILTER_E8E9, + FILTER_UPCASETOLOW, FILTER_AUDIO, FILTER_RGB, FILTER_DELTA, + FILTER_ITANIUM, FILTER_E8E9V2; +} diff --git a/src/com/github/junrar/unpack/decode/LitDecode.java b/src/com/github/junrar/unpack/decode/LitDecode.java new file mode 100644 index 0000000..563566f --- /dev/null +++ b/src/com/github/junrar/unpack/decode/LitDecode.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class LitDecode extends Decode +{ + /** + * + */ + public LitDecode() + { + decodeNum = new int[Compress.NC]; + } + +} diff --git a/src/com/github/junrar/unpack/decode/LowDistDecode.java b/src/com/github/junrar/unpack/decode/LowDistDecode.java new file mode 100644 index 0000000..837eb77 --- /dev/null +++ b/src/com/github/junrar/unpack/decode/LowDistDecode.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class LowDistDecode extends Decode +{ + + /** + * + */ + public LowDistDecode() + { + decodeNum = new int[Compress.LDC]; + } + +} diff --git a/src/com/github/junrar/unpack/decode/MultDecode.java b/src/com/github/junrar/unpack/decode/MultDecode.java new file mode 100644 index 0000000..95db9cf --- /dev/null +++ b/src/com/github/junrar/unpack/decode/MultDecode.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class MultDecode extends Decode +{ + + /** + * + */ + public MultDecode() + { + decodeNum = new int[Compress.MC20]; + } + +} diff --git a/src/com/github/junrar/unpack/decode/RepDecode.java b/src/com/github/junrar/unpack/decode/RepDecode.java new file mode 100644 index 0000000..02f7ef4 --- /dev/null +++ b/src/com/github/junrar/unpack/decode/RepDecode.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2007 innoSysTec (R) GmbH, Germany. All rights reserved. + * Original author: Edmund Wagner + * Creation date: 01.06.2007 + * + * Source: $HeadURL$ + * Last changed: $LastChangedDate$ + * + * the unrar licence applies to all junrar source and binary distributions + * you are not allowed to use this source to re-create the RAR compression algorithm + * + * Here some html entities which can be used for escaping javadoc tags: + * "&": "&" or "&" + * "<": "<" or "<" + * ">": ">" or ">" + * "@": "@" + */ +package com.github.junrar.unpack.decode; + +/** + * DOCUMENT ME + * + * @author $LastChangedBy$ + * @version $LastChangedRevision$ + */ +public class RepDecode extends Decode +{ + /** + * + */ + public RepDecode() + { + decodeNum = new int[Compress.RC]; + } + +} -- cgit v1.2.3