获取下一个有效的byte字符

@param in 输入
@param pos 当前位置，调用此方法后此位置保持在有效字符的下一个位置
@param maxPos 最大位置
@return 有效字符，如果达到末尾返回
17112
private static byte getNextValidDecodeByte(byte[] in, IntWrapper pos, int maxPos) {
		byte base64Byte;
		byte decodeByte;
		while (pos.value <= maxPos) {
			base64Byte = in[pos.value++];
			if (base64Byte > -1) {
				decodeByte = DECODE_TABLE[base64Byte];
				if (decodeByte > -1) {
					return decodeByte;
				}
			}
		}
		// padding if reached max position
		return PADDING;
	}
557127
public void seek(long pos) {
    try {
      raFile.seek(pos);
    } catch (IOException e) {
      logger.log(Level.SEVERE, null, e);
      throw new RuntimeException(e);
    }
  }
1205437
public int putUTF8(int pos, String s) {
		ByteBuffer minibb = null;
		
		CharsetEncoder enc = getUTF8Encoder();
		CharBuffer in = CharBuffer.wrap(s);
		
		int pos2 = pos;
		ByteBuffer bb = getBuffer(pos2);
		int index = pos2 % _bufferSize;
		bb.position(index);
		
		while (in.remaining() > 0) {
			CoderResult res = enc.encode(in, bb, true);
			
			//flush minibb first
			if (bb == minibb) {
				bb.flip();
				while (bb.remaining() > 0) {
					putByte(pos2, bb.get());
					++pos2;
				}
			} else {
				pos2 += bb.position() - index;
			}
			
			if (res.isOverflow()) {
				if (bb.remaining() > 0) {
					//exceeded buffer boundaries; write to a small temporary buffer
					if (minibb == null) {
						minibb = ByteBuffer.allocate(4);
					}
					minibb.clear();
					bb = minibb;
					index = 0;
				} else {
					bb = getBuffer(pos2);
					index = pos2 % _bufferSize;
					bb.position(index);
				}
			} else if (res.isError()) {
				try {
					res.throwException();
				} catch (CharacterCodingException e) {
					throw new RuntimeException("Could not encode string", e);
				}
			}
		}
		
		adaptSize(pos2);
		return pos2 - pos;
	}
466689
static Map<String, Object> maxPayload(final Object max) {
		if (max == null) {
			return null;
		}
		Map<String, Object> payload = new LinkedHashMap<>();
		payload.put("value", max);
		payload.put("message", MSG_PREFIX + VALIDATORS.get(Max.class));
		return payload;
	}
783045
void gatherProtocol(int maxPos) throws IOException {
        // protocol buffer has max capacity, shouldn't need resizing
        try {
            while(this.bufferPosition < maxPos) {
                byte b = this.buffer[this.bufferPosition];
                this.bufferPosition++;

                if (gotCR) {
                    if (b == NatsConnection.LF) {
                        this.protocolBuffer.flip();
                        this.mode = Mode.PARSE_PROTO;
                        this.gotCR = false;
                        break;
                    } else {
                        throw new IllegalStateException("Bad socket data, no LF after CR");
                    }
                } else if (b == NatsConnection.CR) {
                    this.gotCR = true;
                } else {
                    if (!protocolBuffer.hasRemaining()) {
                        this.protocolBuffer = this.connection.enlargeBuffer(this.protocolBuffer, 0); // just double it
                    }
                    this.protocolBuffer.put(b);
                }
            }
        } catch (IllegalStateException | NumberFormatException | NullPointerException ex) {
            this.encounteredProtocolError(ex);
        }
    }
1048477
public final int getInt8(final int pos) {
        if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos);

        return buffer[origin + pos];
    }
33310
function(pos, isAbsolute) {
			return utils.find(this.list(), function(elem) {
				return elem.range(isAbsolute).inside(pos);
			});
		}
1265808
public InputGate<? extends IOReadableWritable> getInputGate(final int pos) {
		if (pos < this.inputGates.size()) {
			return this.inputGates.get(pos);
		}

		return null;
	}
373015
public boolean position(long pos)
    throws IOException
  {
    if (pos < 0) {
      // Return error on seek to negative stream position

      return false;
    }
    
    long delta = pos - position();
    
    long newOffset = _readOffset + delta;
    
    if (newOffset >= 0 && newOffset < _readLength) {
      _readOffset = (int) newOffset;
      
      return true;
    }
    
    if (delta < 0) {
      // Seek backwards in the stream

      _position = pos;
      _readLength = _readOffset = 0;

      if (_source != null) {
        _source.seekStart(pos);

        return true;
      }
      else {
        return false;
      }
    }
    else {
      // Seek forward in the stream, skip any buffered bytes

      long n = pos - position();

      return (skip(n) == n);
    }
  }
417325
private void add(String pos, String s) {
		if(s.length()>maxLen)
			return;
		if(pos.length()==0)
			return;
		posSet.add(pos);
		if(dict.containsKey(s)){
			TreeSet<String> sett = dict.get(s);
			sett.add(pos);
		}else{
			TreeSet<String> sett  = new TreeSet<String>();
			sett.add(pos);
			dict.put(s, sett);
		}
	}
422998
public final long getUlong48(final int pos) {
        final int position = origin + pos;

        if (pos + 5 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
                                                                            + (pos < 0 ? pos : (pos + 5)));

        byte[] buf = buffer;
        return ((long) (0xff & buf[position])) | ((long) (0xff & buf[position + 1]) << 8)
               | ((long) (0xff & buf[position + 2]) << 16) | ((long) (0xff & buf[position + 3]) << 24)
               | ((long) (0xff & buf[position + 4]) << 32) | ((long) (0xff & buf[position + 5]) << 40);
    }
613461
private String getPart(int pos) {
    String value = this.getValue();
    if (value == null) {
      return null;
    }
    String[] parts = value.split("/");
    return parts.length >= pos + 1 ? parts[pos] : null;
  }
1028979
public final int getUint16(final int pos) {
        final int position = origin + pos;

        if (pos + 1 >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: "
                                                                            + (pos < 0 ? pos : (pos + 1)));

        byte[] buf = buffer;
        return (0xff & buf[position]) | ((0xff & buf[position + 1]) << 8);
    }
413563
public static void or(byte[] map, int pos, byte source, int count) {

        int shift = pos & 0x07;
        int mask  = (source & 0xff) >>> shift;
        int index = pos / 8;

        if (index >= map.length) {
            return;
        }

        byte b = (byte) (map[index] | mask);

        map[index] = b;

        if (shift == 0) {
            return;
        }

        shift = 8 - shift;

        if (count > shift) {
            mask           = ((source & 0xff) << 8) >>> shift;
            b              = (byte) (map[index + 1] | mask);
            map[index + 1] = b;
        }
    }
1002024
@Nonnegative
  public int pos (@Nonnegative final int nNewPos)
  {
    ValueEnforcer.isBetweenInclusive (nNewPos, "NewPos", 0, m_aObjs.size ());
    final int nOldPos = m_nPos;
    m_nPos = nNewPos;
    return nOldPos;
  }
1177167
private static void putLong(byte[] array, long l, int pos, int numberOfLongBytes) {
    for (int i = 0; i < numberOfLongBytes; ++i) {
      array[pos + numberOfLongBytes - i - 1] = (byte) (l >>> (i * 8));
    }
  }
1109541
public final int getUint8(final int pos) {
        if (pos >= limit || pos < 0) throw new IllegalArgumentException("limit excceed: " + pos);

        return 0xff & buffer[origin + pos];
    }