Returns a portion of the Bytes object

@param start index of subsequence start (inclusive)
@param end index of subsequence end (exclusive)
496366
public Bytes subSequence(int start, int end) {
    if (start > end || start < 0 || end > length) {
      throw new IndexOutOfBoundsException("Bad start and/end start = " + start + " end=" + end
          + " offset=" + offset + " length=" + length);
    }
    return new Bytes(data, offset + start, end - start);
  }
1304438
public Name subName(int start, int end) {
        if (end < start) end = start;
        return table.fromUtf(getByteArray(), getByteOffset() + start, end - start);
    }
1263169
function slice (start, end) {
  var data

  if (end) {
    debug('slicing array from %d to %d', start, end)
    data = this.buffer.slice(start*this.constructor.BYTES_PER_ELEMENT, end*this.constructor.BYTES_PER_ELEMENT)
  } else {
    debug('slicing array from %d', start)
    data = this.buffer.slice(start*this.constructor.BYTES_PER_ELEMENT)
  }

  return new this.constructor(data)
}
672487
@Override
    public CharSequence subSequence(final int startIndex, final int endIndex) {
      if (startIndex < 0) {
          throw new StringIndexOutOfBoundsException(startIndex);
      }
      if (endIndex > size) {
          throw new StringIndexOutOfBoundsException(endIndex);
      }
      if (startIndex > endIndex) {
          throw new StringIndexOutOfBoundsException(endIndex - startIndex);
      }
      return substring(startIndex, endIndex);
    }
92603
public static int convert(byte[] data, int start) {
        return (Byte.toUnsignedInt(data[start]) << 24) | (Byte.toUnsignedInt(data[start + 1]) << 16)
               | (Byte.toUnsignedInt(data[start + 2]) << 8) | Byte.toUnsignedInt(data[start + 3]);
    }
50652
public void put(byte[] bytes, int start, int end) {
        byte[] buffer = chunk();
        
        for (int i = start; i < end; i++) {
            if (position == buffer.length) {
                buffer = alloc();
            }
            
            buffer[position++] = bytes[i];
            size++;
        }
    }
846336
private static byte[] extractBytes(byte[] scanRecord, int start, int length) {
        byte[] bytes = new byte[length];
        System.arraycopy(scanRecord, start, bytes, 0, length);
        return bytes;
    }
1101458
@Deprecated
	@Override
	public String getSequence(Long beginPosition, Long endPosition) {

		if (beginPosition == null || endPosition == null
				|| (beginPosition > endPosition) || beginPosition < 1
				|| endPosition >getLength()) {
			return null;
		}
		
       int length = (int) (endPosition.longValue() - beginPosition.longValue()) + 1;
	   int offset = beginPosition.intValue() - 1;
	   String subSequence=null;
		try{
			subSequence= ByteBufferUtils.string(getSequenceBuffer(), offset, length);
		}
		catch(Exception e)
		{
			e.printStackTrace();
			return subSequence;
		}
        return subSequence;
		/*// note begin:1 end:4 has length 4
		

		byte[] subsequence = new byte[length];

		
		synchronized (sequence) {
			sequence.position(offset);
			sequence.get(subsequence, 0, length);
		}
		
		String string = new String(subsequence);

		return string;*/
	}
760799
public function substring($start, $end = null)
    {
        if ($end === null) {
            return substr($this->content, $start);
        }
        $len = $end - $start;
        if ($len < 0) {
            return '';
        }
        return substr($this->content, $start, $len);
    }
174595
public function substring($start, $end = null)
	{
		$start = (int) $start;
		$end   = $end !== null ? (int) $end : null;

		if ($start < 0 || $start >= $this->length() || $end !== null && ($end < 0 || $end >= $this->length())) {
			throw new OutOfBoundsException();
		}

		$string = mb_substr($this->string, $start, $end !== null ? $end + 1 : $this->length(), $this->encoding);
		$stringBuilder = new StringBuilder($string);
		$stringBuilder->setEncoding($this->encoding);
		return $stringBuilder;
	}
206650
static public String getEnglishString(byte[] data, int start, int end) {
        int len = end - start;
        if (0 >= len || null == data) {
            return null;
        }
        char chars[] = new char[len];
        for (int i = start; i < end; i++) {
            chars[i] = (char) (data[i] & 0xff);
        }
        return new String(chars);
    }
1083197
public static String toHexString(byte[] bytes, int start, int len) {
        StringBuilder buf = new StringBuilder();
        for (int i = 0; i < len; i++) {
            int b = bytes[start + i] & 0xFF;
            if (b < 16) buf.append('0');
            buf.append(Integer.toHexString(b));
        }
        return buf.toString();
    }
1351585
function slice(start, end) {
    var index = -1,
        object = Object(this),
        length = object.length >>> 0,
        result = [];

    start = toInteger(start);
    start = start < 0 ? max(length + start, 0) : min(start, length);
    start--;
    end = end == null ? length : toInteger(end);
    end = end < 0 ? max(length + end, 0) : min(end, length);

    while ((++index, ++start) < end) {
      if (start in object) {
        result[index] = object[start];
      }
    }
    return result;
  }
1352818
public SourceLocation substringLocation(int start, int end) {
    checkElementIndex(start, rawText.length(), "start");
    checkArgument(start < end);
    checkArgument(end <= rawText.length());
    if (offsets == null) {
      return getSourceLocation();
    }
    return new SourceLocation(
        getSourceLocation().getFilePath(),
        offsets.getPoint(rawText, start),
        // source locations are inclusive, the end locations should point at the last character
        // in the string, whereas substring is usually specified exclusively, so subtract 1 to make
        // up the difference
        offsets.getPoint(rawText, end - 1));
  }
319392
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
    public static Pdu parse(byte[] bytes, int startIndex) {
        Pdu pdu = null;
        if (bytes.length-startIndex >= 2) {
            byte length = bytes[startIndex];
            if (length > 0) {
                byte type = bytes[startIndex + 1];
                int firstIndex = startIndex + 2;
                if (firstIndex < bytes.length) {
                    pdu = new Pdu();
                    // The End index is the startIndex + the length, because the first byte is the
                    // length field and the length field does not include the length field itself in
                    // the count
                    pdu.mEndIndex = startIndex + length;
                    if (pdu.mEndIndex >= bytes.length) {
                        pdu.mEndIndex = bytes.length - 1;
                    }
                    pdu.mType = type;
                    pdu.mDeclaredLength = length;
                    pdu.mStartIndex = firstIndex;
                    pdu.mBytes = bytes;
                }
            }
        }
        return pdu;
    }
903870
public static ByteBuffer copy(ByteBuffer src, int start, int end) {
		return copy(src, ByteBuffer.allocate(end - start));
	}
771883
public char[] toCharArray(int start, int end) {
        int length = end - start;
        if (length == 0) {
            return EmptyArrays.EMPTY_CHARS;
        }

        if (isOutOfBounds(start, length, length())) {
            throw new IndexOutOfBoundsException("expected: " + "0 <= start(" + start + ") <= srcIdx + length("
                            + length + ") <= srcLen(" + length() + ')');
        }

        final char[] buffer = new char[length];
        for (int i = 0, j = start + arrayOffset(); i < length; i++, j++) {
            buffer[i] = b2c(value[j]);
        }
        return buffer;
    }