Changeset 29681 in osm for applications/editors/josm/plugins/opendata/includes/org
- Timestamp:
- 2013-06-21T01:21:01+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/opendata/includes/org/j7zip
- Files:
-
- 4 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/includes/org/j7zip/Common/CRC.java
r29679 r29681 45 45 _value = Table[(_value ^ data[i]) & 0xFF] ^ (_value >>> 8); 46 46 } 47 48 public void Update(byte[] data) { 49 for (int i = 0; i < data.length; i++) 50 _value = Table[(_value ^ data[i]) & 0xFF] ^ (_value >>> 8); 51 } 52 47 53 48 public void Update(byte[] data, int offset, int size) { 54 49 for (int i = 0; i < size; i++) -
applications/editors/josm/plugins/opendata/includes/org/j7zip/Common/IntVector.java
r29679 r29681 49 49 return elt == 0; 50 50 } 51 52 public int Back() {53 if (elt < 1)54 throw new ArrayIndexOutOfBoundsException(0);55 56 return data[elt-1];57 }58 59 public int Front() {60 if (elt < 1)61 throw new ArrayIndexOutOfBoundsException(0);62 63 return data[0];64 }65 66 public void DeleteBack() {67 // Delete(_size - 1);68 remove(elt-1);69 }70 71 public int remove(int index) {72 if (index >= elt)73 throw new ArrayIndexOutOfBoundsException(index);74 int oldValue = data[index];75 76 int numMoved = elt - index - 1;77 if (numMoved > 0)78 System.arraycopy(elt, index+1, elt, index,numMoved);79 80 // data[--elt] = null; // Let gc do its work81 82 return oldValue;83 }84 85 51 } -
applications/editors/josm/plugins/opendata/includes/org/j7zip/Common/LimitedSequentialInStream.java
r29679 r29681 5 5 long _size; 6 6 long _pos; 7 boolean _wasFinished;8 7 9 8 public LimitedSequentialInStream() { … … 17 16 _size = streamSize; 18 17 _pos = 0; 19 _wasFinished = false;20 18 } 21 19 22 20 public int read() throws java.io.IOException { 23 21 int ret = _stream.read(); 24 if (ret == -1) _wasFinished = true;25 22 return ret; 26 23 } … … 35 32 int realProcessedSize = _stream.read(data, off, sizeToRead); 36 33 if (realProcessedSize == -1) { 37 _wasFinished = true;38 34 return -1; 39 35 } -
applications/editors/josm/plugins/opendata/includes/org/j7zip/Common/LockedInStream.java
r29679 r29681 12 12 _stream = stream; 13 13 } 14 15 /* really too slow, don't use ! 16 public synchronized int read(long startPos) throws java.io.IOException 17 { 18 // NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection); 19 _stream.Seek(startPos, IInStream.STREAM_SEEK_SET); 20 return _stream.read(); 21 } 22 */ 23 24 public synchronized int read(long startPos, byte [] data, int size) throws java.io.IOException { 25 // NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection); 26 _stream.Seek(startPos, IInStream.STREAM_SEEK_SET); 27 return _stream.read(data,0, size); 28 } 29 14 30 15 public synchronized int read(long startPos, byte [] data, int off, int size) throws java.io.IOException { 31 16 // NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection); -
applications/editors/josm/plugins/opendata/includes/org/j7zip/Common/RecordVector.java
r29679 r29681 14 14 return get(elementCount-1); 15 15 } 16 17 public E Front() {18 return get(0);19 }20 21 public void DeleteBack() {22 remove(elementCount-1);23 }24 16 } -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/Common/CoderMixer2ST.java
r29679 r29681 21 21 BindInfo _bindInfo = new BindInfo(); 22 22 ObjectVector<STCoderInfo> _coders = new ObjectVector<STCoderInfo>(); 23 int _mainCoderIndex;24 23 25 24 public CoderMixer2ST() { 26 25 } 27 28 26 29 27 public void SetBindInfo(BindInfo bindInfo) { … … 76 74 _bindInfo.FindOutStream(_bindInfo.BindPairs.get(binderIndex).OutIndex, 77 75 tmp1 /* coderIndex */ , tmp2 /* coderStreamIndex */ ); 78 int coderIndex = tmp1[0] , coderStreamIndex = tmp2[0];76 int coderIndex = tmp1[0]; 79 77 80 78 CoderInfo coder = _coders.get(coderIndex); … … 97 95 if (coder.NumInStreams > 1) 98 96 return HRESULT.E_NOTIMPL; 99 for (i = 0; i < (int)coder.NumInStreams; i++) {97 for (i = 0; i < coder.NumInStreams; i++) { 100 98 java.io.InputStream [] tmp = new java.io.InputStream[1]; 101 99 int res = GetInStream(inStreams, useless_inSizes, startIndex + i, tmp /* &seqInStream2 */ ); … … 130 128 _bindInfo.FindInStream(_bindInfo.BindPairs.get(binderIndex).InIndex, 131 129 tmp1 /* coderIndex*/ , tmp2 /* coderStreamIndex */ ); 132 int coderIndex = tmp1[0] , coderStreamIndex = tmp2[0];130 int coderIndex = tmp1[0]; 133 131 134 132 CoderInfo coder = _coders.get(coderIndex); … … 157 155 if (coder.NumOutStreams > 1) 158 156 return HRESULT.E_NOTIMPL; 159 for (i = 0; i < (int)coder.NumOutStreams; i++) {157 for (i = 0; i < coder.NumOutStreams; i++) { 160 158 java.io.OutputStream [] tmp = new java.io.OutputStream[1]; 161 159 int res = GetOutStream(outStreams, useless_outSizes, startIndex + i, tmp /* &seqOutStream2 */ ); … … 208 206 int startInIndex = _bindInfo.GetCoderInStreamIndex(_mainCoderIndex); 209 207 int startOutIndex = _bindInfo.GetCoderOutStreamIndex(_mainCoderIndex); 210 for (i = 0; i < (int)mainCoder.NumInStreams; i++) {208 for (i = 0; i < mainCoder.NumInStreams; i++) { 211 209 java.io.InputStream tmp [] = new java.io.InputStream[1]; 212 210 int res = GetInStream(inStreams, useless_inSizes, startInIndex + i, tmp /* &seqInStream */ ); … … 215 213 seqInStreams.add(seqInStream); 216 214 } 217 for (i = 0; i < (int)mainCoder.NumOutStreams; i++) {215 for (i = 0; i < mainCoder.NumOutStreams; i++) { 218 216 java.io.OutputStream tmp [] = new java.io.OutputStream[1]; 219 217 int res = GetOutStream(outStreams, useless_outSizes, startOutIndex + i, tmp); … … 224 222 RecordVector< java.io.InputStream > seqInStreamsSpec = new RecordVector< java.io.InputStream >(); 225 223 RecordVector< java.io.OutputStream > seqOutStreamsSpec = new RecordVector< java.io.OutputStream >(); 226 for (i = 0; i < (int)mainCoder.NumInStreams; i++)224 for (i = 0; i < mainCoder.NumInStreams; i++) 227 225 seqInStreamsSpec.add(seqInStreams.get(i)); 228 for (i = 0; i < (int)mainCoder.NumOutStreams; i++)226 for (i = 0; i < mainCoder.NumOutStreams; i++) 229 227 seqOutStreamsSpec.add(seqOutStreams.get(i)); 230 228 -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/Common/FilterCoder.java
r29679 r29681 120 120 } 121 121 122 public int ReleaseOutStream() throws IOException {122 /*public int ReleaseOutStream() throws IOException { 123 123 if (_outStream != null) _outStream.close(); // Release() 124 124 _outStream = null; 125 125 return HRESULT.S_OK; 126 } 126 }*/ 127 127 128 128 public void flush() throws IOException { -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/Common/OutStreamWithCRC.java
r29679 r29681 44 44 _stream = null; 45 45 } 46 public long GetSize() {47 return _size;48 }49 46 public int GetCRC() { 50 47 return _crc.GetDigest(); 51 48 } 52 public void InitCRC() {53 _crc.Init();54 }55 49 } -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/IInArchive.java
r29679 r29681 20 20 SevenZipEntry getEntry(int index); 21 21 22 int size();22 //int size(); 23 23 24 24 int close() throws IOException ; … … 34 34 // IArchiveOpenCallback *openArchiveCallback */ 35 35 ) throws java.io.IOException; 36 37 38 36 } 39 37 -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/Decoder.java
r29679 r29681 349 349 int [] tmp1 = new int[1]; 350 350 bindInfo.FindOutStream(bindInfo.OutStreams.get(0), tmp1 /* mainCoder */ , temp_useless /* temp */); 351 int mainCoder = tmp1[0];352 351 353 352 if (_multiThread) { -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/FileItem.java
r29679 r29681 3 3 public class FileItem { 4 4 5 public long CreationTime;5 //public long CreationTime; 6 6 public long LastWriteTime; 7 public long LastAccessTime;7 //public long LastAccessTime; 8 8 9 9 public long UnPackSize; … … 29 29 IsFileCRCDefined = false; 30 30 AreAttributesDefined = false; 31 CreationTime = 0; // IsCreationTimeDefined = false;31 //CreationTime = 0; // IsCreationTimeDefined = false; 32 32 LastWriteTime = 0; // IsLastWriteTimeDefined = false; 33 LastAccessTime = 0; // IsLastAccessTimeDefined = false;33 //LastAccessTime = 0; // IsLastAccessTimeDefined = false; 34 34 IsStartPosDefined = false; 35 35 } -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/Handler.java
r29679 r29681 13 13 import org.j7zip.SevenZip.Common.LocalProgress; 14 14 15 16 17 18 19 20 15 public class Handler implements org.j7zip.SevenZip.Archive.IInArchive { 21 16 … … 26 21 ArchiveDatabaseEx _database; 27 22 28 int _numThreads;29 30 23 public Handler() { 31 _numThreads = 1; // TBD32 33 24 _database = new ArchiveDatabaseEx(); 34 35 25 } 36 26 … … 300 290 return 0; 301 291 } 302 292 /* 303 293 public int size() { 304 294 return _database.Files.size(); 305 } 295 }*/ 306 296 307 297 long getPackSize(int index2) { … … 316 306 317 307 static int GetUInt32FromMemLE(byte [] p , int off) { 318 return p[off] | (( (int)p[off + 1]) << 8) | (((int)p[off + 2]) << 16) | (((int)p[off +3]) << 24);308 return p[off] | ((p[off + 1]) << 8) | ((p[off + 2]) << 16) | ((p[off +3]) << 24); 319 309 } 320 310 -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/Header.java
r29679 r29681 36 36 public static final int kLastWriteTime = 20; 37 37 public static final int kWinAttributes = 21; 38 public static final int kComment = 22;38 //public static final int kComment = 22; 39 39 40 40 public static final int kEncodedHeader = 23; -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/InArchive.java
r29679 r29681 223 223 int SkeepData(long size) throws IOException { 224 224 for (long i = 0; i < size; i++) { 225 int temp =ReadByte();225 /*int temp =*/ ReadByte(); 226 226 } 227 227 return HRESULT.S_OK; … … 681 681 } 682 682 switch((int)type) { 683 case NID.kCreationTime:683 /*case NID.kCreationTime: 684 684 // file.IsCreationTimeDefined = defined; 685 685 if (defined) 686 686 file.CreationTime = FileTimeToLong(high,low); 687 break; 687 break;*/ 688 688 case NID.kLastWriteTime: 689 689 // file.IsLastWriteTimeDefined = defined; … … 691 691 file.LastWriteTime = FileTimeToLong(high,low); 692 692 break; 693 case NID.kLastAccessTime:693 /*case NID.kLastAccessTime: 694 694 // file.IsLastAccessTimeDefined = defined; 695 695 if (defined) 696 696 file.LastAccessTime = FileTimeToLong(high,low); 697 break; 697 break;*/ 698 698 } 699 699 } … … 717 717 IntVector digests = new IntVector(); 718 718 719 int ret =ReadStreamsInfo(null,719 /*int ret =*/ ReadStreamsInfo(null, 720 720 dataOffset, 721 721 packSizes, … … 767 767 int ReadDatabase(ArchiveDatabaseEx database) throws IOException { 768 768 database.Clear(); 769 database.ArchiveInfo.StartPosition = _arhiveBeginStreamPosition;769 //database.ArchiveInfo.StartPosition = _arhiveBeginStreamPosition; 770 770 771 771 byte [] btmp = new byte[2]; … … 775 775 776 776 database.ArchiveInfo.ArchiveVersion_Major = btmp[0]; 777 database.ArchiveInfo.ArchiveVersion_Minor = btmp[1];777 //database.ArchiveInfo.ArchiveVersion_Minor = btmp[1]; 778 778 779 779 if (database.ArchiveInfo.ArchiveVersion_Major != kMajorVersion) -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/InArchiveInfo.java
r29679 r29681 6 6 { 7 7 public byte ArchiveVersion_Major; 8 public byte ArchiveVersion_Minor;8 //public byte ArchiveVersion_Minor; 9 9 10 public long StartPosition;10 //public long StartPosition; 11 11 public long StartPositionAfterHeader; 12 12 public long DataStartPosition; -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Archive/SevenZip/InByte2.java
r29679 r29681 30 30 } 31 31 32 int GetProcessedSize() { return _pos; }32 //int GetProcessedSize() { return _pos; } 33 33 34 34 InByte2() { -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/ArchiveExtractCallback.java
r29679 r29681 55 55 } 56 56 public int PrepareOperation(int askExtractMode) { 57 _extractMode = false;57 /*_extractMode = false; 58 58 switch (askExtractMode) { 59 59 case IInArchive.NExtract_NAskMode_kExtract: 60 60 _extractMode = true; 61 }; 61 };*/ 62 62 switch (askExtractMode) { 63 63 case IInArchive.NExtract_NAskMode_kExtract: … … 186 186 187 187 public long NumErrors; 188 boolean PasswordIsDefined;189 String Password;190 boolean _extractMode;188 //boolean PasswordIsDefined; 189 //String Password; 190 //boolean _extractMode; 191 191 192 192 boolean isDirectory; 193 193 194 public ArchiveExtractCallback() { PasswordIsDefined = false;}194 public ArchiveExtractCallback() { /*PasswordIsDefined = false;*/ } 195 195 196 196 -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Compression/Branch/BCJ2_x86_Decoder.java
r29679 r29681 103 103 int b0 = _callStream.read(); 104 104 // if(b0 == -1) return HRESULT.S_FALSE; 105 src = ( (int)b0) << 24;105 src = (b0) << 24; 106 106 107 107 b0 = _callStream.read(); 108 108 // if(b0 == -1) return HRESULT.S_FALSE; 109 src |= ( (int)b0) << 16;109 src |= (b0) << 16; 110 110 111 111 b0 = _callStream.read(); 112 112 // if(b0 == -1) return HRESULT.S_FALSE; 113 src |= ( (int)b0) << 8;113 src |= (b0) << 8; 114 114 115 115 b0 = _callStream.read(); 116 116 if(b0 == -1) return HRESULT.S_FALSE; 117 src |= ( (int)b0);117 src |= (b0); 118 118 119 119 } else { 120 120 int b0 = _jumpStream.read(); 121 121 // if(b0 == -1) return HRESULT.S_FALSE; 122 src = ( (int)b0) << 24;122 src = (b0) << 24; 123 123 124 124 b0 = _jumpStream.read(); 125 125 // if(b0 == -1) return HRESULT.S_FALSE; 126 src |= ( (int)b0) << 16;126 src |= (b0) << 16; 127 127 128 128 b0 = _jumpStream.read(); 129 129 // if(b0 == -1) return HRESULT.S_FALSE; 130 src |= ( (int)b0) << 8;130 src |= (b0) << 8; 131 131 132 132 b0 = _jumpStream.read(); 133 133 if(b0 == -1) return HRESULT.S_FALSE; 134 src |= ( (int)b0);134 src |= (b0); 135 135 136 136 } … … 140 140 _outStream.WriteByte((dest >> 16)); 141 141 _outStream.WriteByte((dest >> 24)); 142 prevByte = (int)(dest >> 24)& 0xFF;142 prevByte = dest >> 24 & 0xFF; 143 143 processedBytes += 4; 144 144 } else -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Compression/Branch/BCJ_x86_Decoder.java
r29679 r29681 54 54 (prevMask[0] >>> 1) < 0x10) { 55 55 int src = 56 (( int)(b) << 24) |57 (( int)(buffer[bufferPos + 3] & 0xFF) << 16) |58 (( int)(buffer[bufferPos + 2] & 0xFF) << 8) |56 ((b) << 24) | 57 ((buffer[bufferPos + 3] & 0xFF) << 16) | 58 ((buffer[bufferPos + 2] & 0xFF) << 8) | 59 59 (buffer[bufferPos + 1] & 0xFF); 60 60 … … 69 69 break; 70 70 index = kMaskToBitNumber[prevMask[0] >>> 1]; 71 b = ( int)((dest >> (24 - index * 8)) & 0xFF);71 b = (dest >> (24 - index * 8)) & 0xFF; 72 72 if (!Test86MSByte(b)) 73 73 break; -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Compression/LZMA/Base.java
r29679 r29681 5 5 public class Base 6 6 { 7 public static final int kNumRepDistances = 4;7 //public static final int kNumRepDistances = 4; 8 8 public static final int kNumStates = 12; 9 9 … … 43 43 44 44 public static final int kNumPosSlotBits = 6; 45 public static final int kDicLogSizeMin = 0;45 //public static final int kDicLogSizeMin = 0; 46 46 // public static final int kDicLogSizeMax = 28; 47 47 // public static final int kDistTableSizeMax = kDicLogSizeMax * 2; … … 57 57 if (len < kNumLenToPosStates) 58 58 return len; 59 return (int)(kNumLenToPosStates - 1);59 return kNumLenToPosStates - 1; 60 60 } 61 61 62 62 public static final int kNumAlignBits = 4; 63 public static final int kAlignTableSize = 1 << kNumAlignBits;64 public static final int kAlignMask = (kAlignTableSize - 1); 63 /*public static final int kAlignTableSize = 1 << kNumAlignBits; 64 public static final int kAlignMask = (kAlignTableSize - 1);*/ 65 65 66 66 public static final int kStartPosModelIndex = 4; 67 67 public static final int kEndPosModelIndex = 14; 68 public static final int kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;68 //public static final int kNumPosModels = kEndPosModelIndex - kStartPosModelIndex; 69 69 70 70 public static final int kNumFullDistances = 1 << (kEndPosModelIndex / 2); 71 71 72 public static final int kNumLitPosStatesBitsEncodingMax = 4;72 //public static final int kNumLitPosStatesBitsEncodingMax = 4; 73 73 public static final int kNumLitContextBitsMax = 8; 74 74 75 75 public static final int kNumPosStatesBitsMax = 4; 76 76 public static final int kNumPosStatesMax = (1 << kNumPosStatesBitsMax); 77 public static final int kNumPosStatesBitsEncodingMax = 4;78 public static final int kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax); 77 /*public static final int kNumPosStatesBitsEncodingMax = 4; 78 public static final int kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);*/ 79 79 80 80 public static final int kNumLowLenBits = 3; … … 83 83 public static final int kNumLowLenSymbols = 1 << kNumLowLenBits; 84 84 public static final int kNumMidLenSymbols = 1 << kNumMidLenBits; 85 public static final int kNumLenSymbols = kNumLowLenSymbols + kNumMidLenSymbols +85 /*public static final int kNumLenSymbols = kNumLowLenSymbols + kNumMidLenSymbols + 86 86 (1 << kNumHighLenBits); 87 public static final int kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1; 87 public static final int kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1;*/ 88 88 } -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/Compression/LZMA/Decoder.java
r29679 r29681 24 24 extends java.io.InputStream // _ST_MODE 25 25 implements org.j7zip.SevenZip.ICompressCoder , org.j7zip.SevenZip.ICompressSetDecoderProperties2 , 26 org.j7zip.SevenZip.ICompressGetInStreamProcessedSize,27 26 // #ifdef _ST_MODE 28 27 org.j7zip.SevenZip.ICompressSetInStream, … … 180 179 m_posStateMask = numPosStates - 1; 181 180 return true; 182 }183 184 185 public long GetInStreamProcessedSize() {186 throw new UnknownError("GetInStreamProcessedSize");187 // return m_RangeDecoder.GetProcessedSize();188 181 } 189 182 … … 484 477 int dictionarySize = 0; 485 478 for (int i = 0; i < 4; i++) 486 dictionarySize += (( int)(properties[1 + i]) & 0xFF) << (i * 8);479 dictionarySize += ((properties[1 + i]) & 0xFF) << (i * 8); 487 480 if (!SetLcLpPb(lc, lp, pb)) 488 481 return false; -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/ICompressSetOutStream.java
r29679 r29681 3 3 public interface ICompressSetOutStream { 4 4 public int SetOutStream(java.io.OutputStream inStream); 5 public int ReleaseOutStream() throws java.io.IOException;5 //public int ReleaseOutStream() throws java.io.IOException; 6 6 } 7 7 -
applications/editors/josm/plugins/opendata/includes/org/j7zip/SevenZip/MyRandomAccessFile.java
r29679 r29681 26 26 return _file.read(data,off,size); 27 27 } 28 29 public int read(byte [] data, int size) throws java.io.IOException {30 return _file.read(data,0,size);31 }32 28 33 29 public void close() throws java.io.IOException {
Note:
See TracChangeset
for help on using the changeset viewer.