Returns the next b-encoded value on the stream and makes sure it is a
list.

@throws InvalidBEncodingException If it is not a list.
553928
public BEValue bdecodeList() throws IOException {
    int c = this.getNextIndicator();
    if (c != 'l') {
      throw new InvalidBEncodingException("Expected 'l', not '" +
              (char) c + "'");
    }
    this.indicator = 0;

    List<BEValue> result = new ArrayList<BEValue>();
    c = this.getNextIndicator();
    while (c != 'e') {
      result.add(this.bdecode());
      c = this.getNextIndicator();
    }
    this.indicator = 0;

    return new BEValue(result);
  }
888060
List<Long> getPositionList() {
		List<Long> ret = new ArrayList<Long>();

		ret.add(-1L);
		/*
		 * This -1 is pointing to the previous position of the first valid
		 * position of the bit vector, which starts at index 0. Since the zeroth
		 * occurrence of a bit is undefined, the first occurrence can be at
		 * position 0, or later.
		 */

		long count = 0;
		for (long index = 0; index < this.bitVector.size(); index++) {
			if (this.bitVector.getBit(index) == this.bit) {
				count++;
			}
			if (count >= this.blockSize) {
				count = 0;
				ret.add(index);
			}
		}
		return ret;
	}
477950
private int getByte(int position) {
    if (position + 1 >= length) {
      throw new IllegalStateException("Malformed DN: " + dn);
    }

    int b1, b2;

    b1 = chars[position];
    if (b1 >= '0' && b1 <= '9') {
      b1 = b1 - '0';
    } else if (b1 >= 'a' && b1 <= 'f') {
      b1 = b1 - 87; // 87 = 'a' - 10
    } else if (b1 >= 'A' && b1 <= 'F') {
      b1 = b1 - 55; // 55 = 'A' - 10
    } else {
      throw new IllegalStateException("Malformed DN: " + dn);
    }

    b2 = chars[position + 1];
    if (b2 >= '0' && b2 <= '9') {
      b2 = b2 - '0';
    } else if (b2 >= 'a' && b2 <= 'f') {
      b2 = b2 - 87; // 87 = 'a' - 10
    } else if (b2 >= 'A' && b2 <= 'F') {
      b2 = b2 - 55; // 55 = 'A' - 10
    } else {
      throw new IllegalStateException("Malformed DN: " + dn);
    }

    return (b1 << 4) + b2;
  }
286759
public static boolean[] getBits(final byte... bytes) {
        if (bytes.length > 4) {
            throw new InvalidParameterException("Invalid number of bytes");
        }

        final boolean[] res = new boolean[bytes.length * 8];

        int pos = 0;

        for (byte b : bytes) {
            for (boolean bool : getBits(b)) {
                res[pos] = bool;
                pos++;
            }
        }

        return res;
    }
427862
public byte[] getEncodedInternal() throws IOException {
        if (encoded == null) {
            DerOutputStream     out = new DerOutputStream();
            DerOutputStream     tmp = new DerOutputStream();
            for (int i = 0; i < names.length; i++) {
                names[i].encode(tmp);
            }
            out.write(DerValue.tag_Sequence, tmp);
            encoded = out.toByteArray();
        }
        return encoded;
    }
768256
@Nullable
    public JsonToken next() throws IOException, JsonException {
        if (unreadToken != null) {
            JsonToken tmp = unreadToken;
            unreadToken = null;
            return tmp;
        }

        while (lastChar >= 0) {
            if (lastChar == 0) {
                if (!readNextChar()) {
                    break;
                }
            }
            if (lastChar == JsonToken.kNewLine ||
                lastChar == JsonToken.kCarriageReturn ||
                lastChar == JsonToken.kSpace ||
                lastChar == JsonToken.kTab) {
                lastChar = 0;
                continue;
            }

            if (lastChar == JsonToken.kDoubleQuote) {
                return nextString();
            } else if (lastChar == '.' || lastChar == '-' || (lastChar >= '0' && lastChar <= '9')) {
                return nextNumber();
            } else if (lastChar == '_' ||
                       (lastChar >= 'a' && lastChar <= 'z') ||
                       (lastChar >= 'A' && lastChar <= 'Z')) {
                return nextToken();
            } else if (lastChar < 0x20 || lastChar >= 0x7F) {
                // UTF-8 characters are only allowed inside JSON string literals.
                throw newParseException("Illegal character in JSON structure: '\\u%04x'", lastChar);
            } else {
                return nextSymbol();
            }
        }

        return null;
    }
707263
public Object nextValue() throws JSONException {
		int c = nextCleanInternal();
		switch (c) {
		case -1:
			throw syntaxError("End of input");

		case '{':
			return readObject();

		case '[':
			return readArray();

		case '\'':
		case '"':
			return nextString((char) c);

		default:
			this.pos--;
			return readLiteral();
		}
	}
881758
public char next() throws JSONException {

        if (m_useLastChar) {
            m_useLastChar = false;
            if (m_lastChar != 0) {
                m_index += 1;
            }
            return m_lastChar;
        }
        int c;
        try {
            c = m_reader.read();
        } catch (IOException exc) {
            throw new JSONException(exc);
        }

        if (c <= 0) { // End of stream
            m_lastChar = 0;
            return 0;
        }
        m_index += 1;
        m_lastChar = (char)c;
        return m_lastChar;
    }
938290
protected int processResponse(byte[] b) {
        if ( DumpProtocol ) {
            try {
                System.out.println("resp:"+new String(b,"UTF-8"));
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
        }
        Object o[] = (Object[]) conf.asObject(b);
        if ( SENDDEBUG )
            System.out.println("RECEIVE:"+(o.length-1));
        int seq = ((Number) o[o.length - 1]).intValue();
        if ( seq == lastSeenSeq+1 || lastSeenSeq == 0 || noSeqChecking ) {
            lastSeenSeq = seq;
            processDecodedResultArray(o);
            Object next[];
            while ( (next = (Object[]) sequenceCache.get(lastSeenSeq + 1)) != null ) {
                lastSeenSeq++;
                sequenceCache.remove(lastSeenSeq);
                log("replay "+lastSeenSeq);
                processDecodedResultArray(next);
            }
        } else {
            log("ignored result with sequence:" + seq + " lastSeen:" + lastSeenSeq);
            if ( seq > lastSeenSeq ) {
                sequenceCache.put(seq,o);
                if ( sequenceCache.size() > 5 ) {
                    disconnect("Unrecoverable Gap");
                }
            }
        }
        return o.length-1;
    }
262368
int next() throws IOException, UnterminatedCommentException {
		int c = get();
		if (c == '/') {
			switch (peek()) {
			case '/':
				for (;;) {
					c = get();
					if (c <= '\n') {
						return c;
					}
				}

			case '*':
				get();
				for (;;) {
					switch (get()) {
					case '*':
						if (peek() == '/') {
							get();
							return ' ';
						}
						break;
					case EOF:
						throw new UnterminatedCommentException();
					}
				}

			default:
				return c;
			}

		}
		return c;
	}
162704
@Nonnull
  public ICommonsList <String> next ()
  {
    final ICommonsList <String> ret = m_aNextLine;
    if (ret == null)
      throw new NoSuchElementException ();

    try
    {
      m_aNextLine = m_aReader.readNext ();
    }
    catch (final IOException ex)
    {
      throw new IllegalStateException ("Failed to read next CSV line", ex);
    }
    return ret;
  }
478698
static CompactCharSequence[][] getAllValuesCompactCharSequence(InputStream is, char delimiter) throws Exception {
		// FileReader reader = new FileReader(fileName);

		BufferedReader br = new BufferedReader(new InputStreamReader(is));


		ArrayList<CompactCharSequence[]> rows = new ArrayList<CompactCharSequence[]>();

		String line = br.readLine();
		int numcolumns = -1;
		while (line != null) {
			String[] d = line.split(String.valueOf(delimiter));
			if (numcolumns == -1) {
				numcolumns = d.length;
			}
			CompactCharSequence[] ccs = new CompactCharSequence[d.length];
			for (int i = 0; i < d.length; i++) {
				ccs[i] = new CompactCharSequence(d[i]);
			}
			rows.add(ccs);

			line = br.readLine();
		}
		br.close();
		// reader.close();

		CompactCharSequence[][] data = new CompactCharSequence[rows.size()][numcolumns];
		for (int i = 0; i < rows.size(); i++) {
			CompactCharSequence[] row = rows.get(i);
			for (int j = 0; j < row.length; j++) { //
				if (row[j].length() > 1 && row[j].charAt(0) == '"') {
					// System.out.println(row[j]);
					if (row[j].length() > 2) {
						row[j] = new CompactCharSequence(row[j].subSequence(1, row[j].length() - 1).toString());
					} else {
						row[j] = new CompactCharSequence("");
					}
				}
				if (j < row.length && j < data[0].length) {
					data[i][j] = row[j];
				}
			}


		}

		return data;

	}
909740
public String[] getAsStringArray(byte b) {
		String s = get(b);
		if (s == null)
			return null;
		else
			return s.split(lineSeparator+"");
	}
1194553
@Override
  public KeyValue<K, Iterator<V>> next() throws NoSuchElementException {
    if (combineValues) {
      skipLeftoverItems();
    }
    PeekingInputReader<KeyValue<ByteBuffer, ? extends Iterable<V>>> reader =
        lowestReaderQueue.remove();
    KeyValue<ByteBuffer, ? extends Iterable<V>> lowest = reader.next();
    ByteBuffer lowestKey = lowest.getKey();
    addReaderToQueueIfNotEmpty(reader);
    lastKey = SerializableValue.of(getByteBufferMarshaller(), lowestKey);
    if (combineValues) {
      CombiningReader values = new CombiningReader(lowestKey, lowest.getValue());
      return new KeyValue<K, Iterator<V>>(keyMarshaller.fromBytes(lowestKey.slice()), values);
    } else {
      return new KeyValue<>(keyMarshaller.fromBytes(lowestKey.slice()),
          lowest.getValue().iterator());
    }
  }
395234
@Override
    public int read() throws IOException {
        int nextChar = super.read();

        // process the character
        if ( nextChar != -1 ) {
            if ( nextChar == '\n' ) {
                m_line++;
                pushColumn( m_column );
                m_column = 0;
            }
            else if ( nextChar == '\r') {
                int aheadChar = super.read();

                // if the lookahead is not a newline combo, unread it
                if ( aheadChar != '\n' ) {
                    // no need to unread it with line/offset update.
                    unreadImpl( aheadChar, false );
                }

                m_line++;
                pushColumn( m_column );
                m_column = 0;

                // normalize
                nextChar = '\n';
            } else {
                m_column++;
            }
            m_consumed++;
        }

        return nextChar;
    }
13248
public int decode(byte[] b) throws ParameterException {
        if (b == null || b.length != 1) {
            throw new ParameterException("byte[] must  not be null and length must  be 1");
        }

        this.transimissionMediumUsed = b[0];

        return 1;
    }
922462
final int compareHalf(MutableBigInteger b) {
        int blen = b.intLen;
        int len = intLen;
        if (len <= 0)
            return blen <= 0 ? 0 : -1;
        if (len > blen)
            return 1;
        if (len < blen - 1)
            return -1;
        int[] bval = b.value;
        int bstart = 0;
        int carry = 0;
        // Only 2 cases left:len == blen or len == blen - 1
        if (len != blen) { // len == blen - 1
            if (bval[bstart] == 1) {
                ++bstart;
                carry = 0x80000000;
            } else
                return -1;
        }
        // compare values with right-shifted values of b,
        // carrying shifted-out bits across words
        int[] val = value;
        for (int i = offset, j = bstart; i < len + offset;) {
            int bv = bval[j++];
            long hb = ((bv >>> 1) + carry) & LONG_MASK;
            long v = val[i++] & LONG_MASK;
            if (v != hb)
                return v < hb ? -1 : 1;
            carry = (bv & 1) << 31; // carray will be either 0x80000000 or 0
        }
        return carry == 0 ? 0 : -1;
    }