01: /**
02: * PackedBitObj is (c) 2006 Paul Brooks Andrus and is released under the MIT License:
03: * http://www.opensource.org/licenses/mit-license.php
04: *
05: * http://www.brooksandrus.com/blog/2006/08/01/lightweight-swf-header-reader-java/
06: * package com.brooksandrus.utils.swf
07: */package org.apache.portals.gems.flash;
08:
09: /**
10: * @author brooks
11: *
12: */
13: public class PackedBitObj {
14: public int bitIndex = 0;
15: public int byteIndex = 0;
16: public int value = 0;
17: public int nextBitIndex = 0;
18: public int nextByteIndex = 0;
19: public int nextByteBoundary = 0;
20:
21: /**
22: * @param bitIndex
23: * The index of the last bit read
24: * @param byteMarker
25: * The index of the last byte read
26: * @param decimalValue
27: * The decimal value of the packed bit sequence
28: * @param binaryString
29: *
30: */
31: public PackedBitObj(int bitMarker, int byteMarker, int decimalValue) {
32: bitIndex = bitMarker;
33: byteIndex = byteMarker;
34: value = decimalValue;
35: nextBitIndex = bitMarker;
36:
37: if (bitMarker <= 7) {
38: nextBitIndex++;
39: nextByteIndex = byteMarker;
40: nextByteBoundary = byteMarker++;
41: } else {
42: nextBitIndex = 0;
43: nextByteIndex++;
44: nextByteBoundary = nextByteIndex;
45: }
46: }
47:
48: }
|