Changeset 29681 in osm for applications/editors/josm/plugins/opendata/includes/org/j7zip/Common
- Timestamp:
- 2013-06-21T01:21:01+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/opendata/includes/org/j7zip/Common
- Files:
-
- 5 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 }
Note:
See TracChangeset
for help on using the changeset viewer.