Revision 9978
trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/DwgUtil.java | ||
---|---|---|
400 | 400 |
* when we are looking for LwPolylines. |
401 | 401 |
* @return ArrayList This ArrayList has two parts. First is an int value that represents |
402 | 402 |
* the new offset, and second is the long value |
403 |
* @throws Exception |
|
403 | 404 |
*/ |
404 |
public static ArrayList getRawLong(int[] data, int offset) { |
|
405 |
public static ArrayList getRawLong(int[] data, int offset) throws Exception {
|
|
405 | 406 |
ArrayList v = new ArrayList(); |
406 |
// TODO: Incorrecto. Repasar ... |
|
407 | 407 |
// _val = struct.unpack('<l', _long)[0] |
408 |
int val = 0; |
|
408 |
byte[] bytes = (byte[])getBits(data, 32, offset); |
|
409 |
ByteBuffer bb = ByteBuffer.wrap(bytes); |
|
410 |
bb.order(ByteOrder.LITTLE_ENDIAN); |
|
411 |
int val = bb.getInt(); |
|
409 | 412 |
v.add(new Integer(offset+32)); |
410 | 413 |
v.add(new Integer(val)); |
411 | 414 |
return v; |
... | ... | |
477 | 480 |
*/ |
478 | 481 |
public static ArrayList getTextString(int[] data, int offset) throws Exception { |
479 | 482 |
int bitPos = offset; |
480 |
int newBitPos = ((Integer)DwgUtil.getBitShort(data, bitPos).get(0)).intValue(); |
|
481 |
int len = ((Integer)DwgUtil.getBitShort(data, bitPos).get(1)).intValue(); |
|
483 |
ArrayList bitShort = DwgUtil.getBitShort(data, bitPos); |
|
484 |
int newBitPos = ((Integer)bitShort.get(0)).intValue(); |
|
485 |
int len = ((Integer)bitShort.get(1)).intValue(); |
|
482 | 486 |
bitPos = newBitPos; |
483 | 487 |
int bitLen = len * 8; |
484 | 488 |
Object cosa = DwgUtil.getBits(data, bitLen, bitPos); |
Also available in: Unified diff