/** * Gets the {@code signed byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code signed byte} at that offset */ public int getByte(int off) { checkOffsets(off, off + 1); return getByte0(off); }
/** * Gets the {@code unsigned byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code unsigned byte} at that offset */ public int getUnsignedByte(int off) { checkOffsets(off, off + 1); return getUnsignedByte0(off); }
/** * Returns a slice (that is, a sub-array) of this instance. * * @param start {@code >= 0;} start index of the slice (inclusive) * @param end {@code >= start, <= size();} end index of * the slice (exclusive) * @return {@code non-null;} the slice */ public ByteArray slice(int start, int end) { checkOffsets(start, end); return new ByteArray(bytes, start + this.start, end + this.start); }
/** * Returns a slice (that is, a sub-array) of this instance. * * @param start {@code >= 0;} start index of the slice (inclusive) * @param end {@code >= start, <= size();} end index of * the slice (exclusive) * @return {@code non-null;} the slice */ public ByteArray slice(int start, int end) { checkOffsets(start, end); return new ByteArray(bytes, start + this.start, end + this.start); }
/** * Gets the {@code unsigned byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code unsigned byte} at that offset */ public int getUnsignedByte(int off) { checkOffsets(off, off + 1); return getUnsignedByte0(off); }
/** * Gets the {@code signed byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code signed byte} at that offset */ public int getByte(int off) { checkOffsets(off, off + 1); return getByte0(off); }
/** * Returns a slice (that is, a sub-array) of this instance. * * @param start {@code >= 0;} start index of the slice (inclusive) * @param end {@code >= start, <= size();} end index of * the slice (exclusive) * @return {@code non-null;} the slice */ public ByteArray slice(int start, int end) { checkOffsets(start, end); return new ByteArray(bytes, start + this.start, end + this.start); }
/** * Gets the {@code unsigned byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code unsigned byte} at that offset */ public int getUnsignedByte(int off) { checkOffsets(off, off + 1); return getUnsignedByte0(off); }
/** * Gets the {@code signed byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code signed byte} at that offset */ public int getByte(int off) { checkOffsets(off, off + 1); return getByte0(off); }
/** * Gets the {@code unsigned byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code unsigned byte} at that offset */ public int getUnsignedByte(int off) { checkOffsets(off, off + 1); return getUnsignedByte0(off); }
/** * Gets the {@code signed byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code signed byte} at that offset */ public int getByte(int off) { checkOffsets(off, off + 1); return getByte0(off); }
/** * Gets the {@code unsigned byte} value at a particular offset. * * @param off {@code >= 0, < size();} offset to fetch * @return {@code unsigned byte} at that offset */ public int getUnsignedByte(int off) { checkOffsets(off, off + 1); return getUnsignedByte0(off); }
/** * Returns a slice (that is, a sub-array) of this instance. * * @param start {@code >= 0;} start index of the slice (inclusive) * @param end {@code >= start, <= size();} end index of * the slice (exclusive) * @return {@code non-null;} the slice */ public ByteArray slice(int start, int end) { checkOffsets(start, end); return new ByteArray(bytes, start + this.start, end + this.start); }
/** * Gets the {@code unsigned short} value at a particular offset. * * @param off {@code >= 0, < (size() - 1);} offset to fetch * @return {@code unsigned short} at that offset */ public int getUnsignedShort(int off) { checkOffsets(off, off + 2); return (getUnsignedByte0(off) << 8) | getUnsignedByte0(off + 1); }
/** * Gets the {@code unsigned short} value at a particular offset. * * @param off {@code >= 0, < (size() - 1);} offset to fetch * @return {@code unsigned short} at that offset */ public int getUnsignedShort(int off) { checkOffsets(off, off + 2); return (getUnsignedByte0(off) << 8) | getUnsignedByte0(off + 1); }
/** * Gets the {@code signed short} value at a particular offset. * * @param off {@code >= 0, < (size() - 1);} offset to fetch * @return {@code signed short} at that offset */ public int getShort(int off) { checkOffsets(off, off + 2); return (getByte0(off) << 8) | getUnsignedByte0(off + 1); }
/** * Gets the {@code signed short} value at a particular offset. * * @param off {@code >= 0, < (size() - 1);} offset to fetch * @return {@code signed short} at that offset */ public int getShort(int off) { checkOffsets(off, off + 2); return (getByte0(off) << 8) | getUnsignedByte0(off + 1); }
/** * Gets the {@code signed short} value at a particular offset. * * @param off {@code >= 0, < (size() - 1);} offset to fetch * @return {@code signed short} at that offset */ public int getShort(int off) { checkOffsets(off, off + 2); return (getByte0(off) << 8) | getUnsignedByte0(off + 1); }
/** * Gets the {@code unsigned short} value at a particular offset. * * @param off {@code >= 0, < (size() - 1);} offset to fetch * @return {@code unsigned short} at that offset */ public int getUnsignedShort(int off) { checkOffsets(off, off + 2); return (getUnsignedByte0(off) << 8) | getUnsignedByte0(off + 1); }
/** * Gets the {@code unsigned short} value at a particular offset. * * @param off {@code >= 0, < (size() - 1);} offset to fetch * @return {@code unsigned short} at that offset */ public int getUnsignedShort(int off) { checkOffsets(off, off + 2); return (getUnsignedByte0(off) << 8) | getUnsignedByte0(off + 1); }