Class BytesLocation

    • Constructor Detail

      • BytesLocation

        public BytesLocation​(int initialCapacity)
        Creates a BytesLocation backed by a ByteArrayByteBank with the specified initial capacity, but with a reported size of 0. This method can be used to avoid needing to grow the underlying ByteBank.
      • BytesLocation

        public BytesLocation​(int initialCapacity,
                             String name)
        Creates a BytesLocation backed by a ByteArrayByteBank with the specified initial capacity, but with a reported size of 0. This method can be used to avoid needing to grow the underlying ByteBank.
        Parameters:
        name - the name of this Location
      • BytesLocation

        public BytesLocation​(byte[] bytes)
        Creates a BytesLocation backed by a ByteArrayByteBank which wraps the specified array.
        Parameters:
        bytes - the array to wrap
      • BytesLocation

        public BytesLocation​(byte[] bytes,
                             String name)
        Creates a BytesLocation backed by a ByteArrayByteBank which wraps the specified array.
        Parameters:
        bytes - the array to wrap
        name - the name of this Location.
      • BytesLocation

        public BytesLocation​(byte[] bytes,
                             int offset,
                             int length)
        Creates a BytesLocation backed by a ByteArrayByteBank with the specified initial capacity and the provided data.
        Parameters:
        bytes - the bytes to copy into the new BytesLocation
        offset - the offset in the bytes array to start copying from
        length - the number of bytes to copy, starting from the offset
      • BytesLocation

        public BytesLocation​(byte[] bytes,
                             int offset,
                             int length,
                             String name)
        Creates a BytesLocation backed by a ByteArrayByteBank with the specified initial capacity and the provided data.
        Parameters:
        bytes - the bytes to copy into the new BytesLocation
        offset - the offset in the bytes array to start copying from
        length - the number of bytes to copy, starting from the offset
        name - the name of this Location.
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Location
        Gets a (typically short) name expressing this location. This string is not intended to unambiguously identify the location, but rather act as a friendly, human-readable name. The precise behavior will depend on the implementation, but as an example, a file-based location could return the name of the associated file without its full path.
        Returns:
        The name, or an empty string if no name is available.