/** * Constructs an instance. * * @param bytes {@code non-null;} the bytes of the file * @param filePath {@code non-null;} the file path for the class, * excluding any base directory specification * @param strictParse whether to be strict about parsing; if * {@code false}, this avoids doing checks that only exist * for purposes of verification (such as magic number matching and * path-package consistency checking) */ public DirectClassFile(byte[] bytes, String filePath, boolean strictParse) { this(new ByteArray(bytes), filePath, strictParse); }
/** * Constructs an instance. * * @param bytes {@code non-null;} the bytes of the file * @param filePath {@code non-null;} the file path for the class, * excluding any base directory specification * @param strictParse whether to be strict about parsing; if * {@code false}, this avoids doing checks that only exist * for purposes of verification (such as magic number matching and * path-package consistency checking) */ public DirectClassFile(byte[] bytes, String filePath, boolean strictParse) { this(new ByteArray(bytes), filePath, strictParse); }
/** * Constructs an instance. * * @param bytes {@code non-null;} the bytes of the file * @param filePath {@code non-null;} the file path for the class, * excluding any base directory specification * @param strictParse whether to be strict about parsing; if * {@code false}, this avoids doing checks that only exist * for purposes of verification (such as magic number matching and * path-package consistency checking) */ public DirectClassFile(byte[] bytes, String filePath, boolean strictParse) { this(new ByteArray(bytes), filePath, strictParse); }
/** * Constructs an instance. * * @param bytes {@code non-null;} the bytes of the file * @param filePath {@code non-null;} the file path for the class, * excluding any base directory specification * @param strictParse whether to be strict about parsing; if * {@code false}, this avoids doing checks that only exist * for purposes of verification (such as magic number matching and * path-package consistency checking) */ public DirectClassFile(byte[] bytes, String filePath, boolean strictParse) { this(new ByteArray(bytes), filePath, strictParse); }
/** * Constructs an instance from a {@code String}. * * @param string {@code non-null;} the UTF-8 value as a string */ public CstString(String string) { if (string == null) { throw new NullPointerException("string == null"); } this.string = string.intern(); this.bytes = new ByteArray(stringToUtf8Bytes(string)); }
/** * 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); }
/** * Constructs an instance from a {@code String}. * * @param string {@code non-null;} the UTF-8 value as a string */ public CstString(String string) { if (string == null) { throw new NullPointerException("string == null"); } this.string = string.intern(); this.bytes = new ByteArray(stringToUtf8Bytes(string)); }
/** * Constructs an instance from a {@code String}. * * @param string {@code non-null;} the UTF-8 value as a string */ public CstString(String string) { if (string == null) { throw new NullPointerException("string == null"); } this.string = string.intern(); this.bytes = new ByteArray(stringToUtf8Bytes(string)); }
/** * 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); }
/** * Constructs an instance from a {@code String}. * * @param string {@code non-null;} the UTF-8 value as a string */ public CstString(String string) { if (string == null) { throw new NullPointerException("string == null"); } this.string = string.intern(); this.bytes = new ByteArray(stringToUtf8Bytes(string)); }
/** * Constructs an instance from a {@code String}. * * @param string {@code non-null;} the UTF-8 value as a string */ public CstString(String string) { if (string == null) { throw new NullPointerException("string == null"); } this.string = string.intern(); this.bytes = new ByteArray(stringToUtf8Bytes(string)); }
/** * Constructs an instance from a {@code String}. * * @param string {@code non-null;} the UTF-8 value as a string */ public CstString(String string) { if (string == null) { throw new NullPointerException("string == null"); } this.string = string.intern(); this.bytes = new ByteArray(stringToUtf8Bytes(string)); }
/** * Constructs an instance from a {@code String}. * * @param string {@code non-null;} the UTF-8 value as a string */ public CstString(String string) { if (string == null) { throw new NullPointerException("string == null"); } this.string = string.intern(); this.bytes = new ByteArray(stringToUtf8Bytes(string)); }
/** * 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); }
/** * 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); }
/** * Constructs an instance from a {@code String}. * * @param string {@code non-null;} the UTF-8 value as a string */ public CstUtf8(String string) { if (string == null) { throw new NullPointerException("string == null"); } this.string = string.intern(); this.bytes = new ByteArray(stringToUtf8Bytes(string)); }
/** * 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); byte[] slicedOut = Arrays.copyOfRange(bytes, start, end); return new ByteArray(slicedOut); }