mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
Issue 882 few more small DM issues
git-svn-id: https://zxing.googlecode.com/svn/trunk@1865 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
13f529aa80
commit
645a03c6a5
|
@ -20,7 +20,7 @@ package com.google.zxing.common;
|
|||
* <p>This provides an easy abstraction to read bits at a time from a sequence of bytes, where the
|
||||
* number of bits read is not often a multiple of 8.</p>
|
||||
*
|
||||
* <p>This class is thread-safe but not reentrant. Unless the caller modifies the bytes array
|
||||
* <p>This class is thread-safe but not reentrant -- unless the caller modifies the bytes array
|
||||
* it passed in, in which case all bets are off.</p>
|
||||
*
|
||||
* @author Sean Owen
|
||||
|
@ -39,6 +39,13 @@ public final class BitSource {
|
|||
this.bytes = bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return index of next byte in input byte array which would be read by the next call to {@link #readBits(int)}.
|
||||
*/
|
||||
public int getByteOffset() {
|
||||
return byteOffset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param numBits number of bits to read
|
||||
* @return int representing the bits read. The bits will appear as the least-significant
|
||||
|
|
|
@ -235,7 +235,7 @@ final class DecodedBitStreamParser {
|
|||
result.append(c40char);
|
||||
}
|
||||
} else if (cValue == 27) { // FNC1
|
||||
throw FormatException.getFormatInstance();
|
||||
// ignore
|
||||
} else if (cValue == 30) { // Upper Shift
|
||||
upperShift = true;
|
||||
} else {
|
||||
|
@ -437,7 +437,7 @@ final class DecodedBitStreamParser {
|
|||
private static void decodeBase256Segment(BitSource bits, StringBuffer result, Vector byteSegments)
|
||||
throws FormatException {
|
||||
// Figure out how long the Base 256 Segment is.
|
||||
int codewordPosition = 2;
|
||||
int codewordPosition = 1 + bits.getByteOffset(); // position is 1-indexed
|
||||
int d1 = unrandomize255State(bits.readBits(8), codewordPosition++);
|
||||
int count;
|
||||
if (d1 == 0) { // Read the remainder of the symbol
|
||||
|
|
Loading…
Reference in a new issue