Tests if the buffer ends with the bytes array prefix. The byte array
prefix must have a size >= this buffer's size.
@return True if the buffer ends with the bytes array, otherwise false.
764805
public boolean endsWith(byte[] prefix) {
        //logger.debug("Inside endsWith()");
        if ((prefix.length == 0) || (prefix.length > size())) {
            //It could not match :
            return false;
        }
        boolean match = true;
        int i = prefix.length - 1;
        int j = (this.currentWritePosition - 1 + this.buffer.length) % this.buffer.length;
        while (match && (i >= 0)) {
            //logger.debug("endsWith() this.buffer["+j+"]=" + this.buffer[j] + "='" + (char)this.buffer[j] + "', prefix["+i+"]=" + prefix[i] + "='" + (char)prefix[i] + "'");
            if (this.buffer[j] != prefix[i]) {
                match = false;
            }
            i--;
            j = (j - 1 + this.buffer.length) % this.buffer.length;
        }
        return match;
    }
197936
protected boolean checkBuffer() throws IOException {
        if (!enableMultiReadofPostData) {
            if (null != this.buffer) {
                if (this.buffer.hasRemaining()) {
                    return true;
                }
                this.buffer.release();
                this.buffer = null;
            }
            try {
                this.buffer = this.isc.getRequestBodyBuffer();
                if (null != this.buffer) {
                    // record the new amount of data read from the channel
                    this.bytesRead += this.buffer.remaining();
                    // Tr.debug(tc, "Buffer=" + WsByteBufferUtils.asString(this.buffer));
                    return true;
                }
                return false;
            } catch (IOException e) {
                this.error = e;
                throw e;
            }
        } else {
            return checkMultiReadBuffer();
        }
    }
629630
@Override
	public boolean containsPrefixBlock(int prefixLength) {
		checkSubnet(this, prefixLength);
		int divisionCount = getDivisionCount();
		int prevBitCount = 0;
		for(int i = 0; i < divisionCount; i++) {
			AddressDivision division = getDivision(i);
			int bitCount = division.getBitCount();
			int totalBitCount = bitCount + prevBitCount;
			if(prefixLength < totalBitCount) {
				int divPrefixLen = Math.max(0, prefixLength - prevBitCount);
				if(!division.isPrefixBlock(division.getDivisionValue(), division.getUpperDivisionValue(), divPrefixLen)) {
					return false;
				}
				for(++i; i < divisionCount; i++) {
					division = getDivision(i);
					if(!division.isFullRange()) {
						return false;
					}
				}
				return true;
			}
			prevBitCount = totalBitCount;
		}
		return true;
	}
1224036
@Override
    public boolean isNewLine(byte[]bytes, int p, int end) {
        return p < end ? bytes[p] == Encoding.NEW_LINE : false;
    }
1184291
private boolean makeSpace() {
        clearCaches();
        int offset = savedScannerPosition == -1 ?
            position : savedScannerPosition;
        buf.position(offset);
        // Gain space by compacting buffer
        if (offset > 0) {
            buf.compact();
            translateSavedIndexes(offset);
            position -= offset;
            buf.flip();
            return true;
        }
        // Gain space by growing buffer
        int newSize = buf.capacity() * 2;
        CharBuffer newBuf = CharBuffer.allocate(newSize);
        newBuf.put(buf);
        newBuf.flip();
        translateSavedIndexes(offset);
        position -= offset;
        buf = newBuf;
        matcher.reset(buf);
        return true;
    }
296911
private boolean isPayloadTooLong() {
		try {
			byte[] bytes = getPayloadAsBytesUnchecked();
			if (bytes.length > getMaximumPayloadSize()) return true;
		} catch (Exception e) {
		}
		return false;
	}
134780
private int ensureBuffer(int offset, int length) throws IOException {
		final int lastPos = offset + length - 1;
		final int desiredSize = ((lastPos / BUFFER_SIZE) + 1) * BUFFER_SIZE;
		final int currentSize = this.buffer.length;

		if (desiredSize > currentSize) {
			final byte[] readBuffer = new byte[desiredSize - currentSize];
			final int count = this.in.read(readBuffer);

			if (count > 0) {
				final byte[] newBuffer = new byte[currentSize + count];
				System.arraycopy(this.buffer, 0, newBuffer, 0, currentSize);
				System.arraycopy(readBuffer, 0, newBuffer, currentSize, count);
				this.buffer = newBuffer;
			}
			return (lastPos < this.buffer.length) ? length : length - (lastPos - this.buffer.length + 1);
		}
		return length;
	}
1159186
protected function end()
    {
        if ($this->literal(';')) {
            return true;
        } elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') {
            // if there is end of file or a closing block next then we don't need a ;
            return true;
        }

        return false;
    }
399441
def is_end(self, char):
        
        char = char.lower()

        return bool(cgaddag.gdg_is_end(self.gdg, self.node, char.encode("ascii")))
520599
public boolean endsWith(String str, String suffix) {
        return (str == null || suffix == null) ? (str == suffix) :
            str.endsWith(suffix);
    }
673177
private boolean checkBuffer(long offset) throws IOException {
    if (offset - bufferOffset < 0 || offset - bufferOffset >= currentBufferSize) {
      // the given offset is not contained in the buffer
      bufferOffset = offset;
      int index = 0;
      input.seek(offset);
      try {
        //input.read(buffer, 0, maxBufferSize);
        for (long pos = offset; pos < offset + maxBufferSize; pos++) {
          int ch = input.read();
          if (ch > -1) {
            buffer[index] = (byte)ch;
            index++;
          }
        }
      } catch (IOException ex) {
        // not possible
        ex.printStackTrace();
      }
      currentBufferSize = index;
      return true;
    }
    return false;
  }
1310194
@Override
	public boolean isSinglePrefixBlock() {
		Integer networkPrefixLength = getNetworkPrefixLength();
		if(networkPrefixLength == null) {
			return false;
		}
		return containsSinglePrefixBlock(networkPrefixLength);
	}
580682
@Override
	public boolean hasNext() {
		if (!isForward) {
			currentRec = currentRec - pointerSize;
			isForward = true;
		}
		return currentRec > 0 || blk.number() > 0;
	}
826157
boolean canAppend() {
    return appending == 0 || (appendSucceeded && appending < MAX_APPENDS && System.nanoTime() - (timeBuffer.average() / MAX_APPENDS) >= appendTime);
  }
671810
protected boolean finalizeAny() {
        GlobalSplitter<I, D> splitter = findSplitterGlobal();
        if (splitter != null) {
            finalizeDiscriminator(splitter.blockRoot, splitter.localSplitter);
            return true;
        }
        return false;
    }
204439
public boolean validate() {

        if (m_end >= m_length) {
            m_end = m_length - 1;
        }

        return ((m_start >= 0) && (m_end >= 0) && (m_start <= m_end) && (m_length > 0));
    }
539985
public boolean isCompleteAt(int length) {
    if (mImageFormat != DefaultImageFormats.JPEG) {
      return true;
    }
    // If the image is backed by FileInputStreams return true since they will always be complete.
    if (mInputStreamSupplier != null) {
      return true;
    }
    // The image should be backed by a ByteBuffer
    Preconditions.checkNotNull(mPooledByteBufferRef);
    PooledByteBuffer buf = mPooledByteBufferRef.get();
    return (buf.read(length - 2) == (byte) JfifUtil.MARKER_FIRST_BYTE)
        && (buf.read(length - 1) == (byte) JfifUtil.MARKER_EOI);
  }