Class ByteArrayInterface

java.lang.Object
com.reve.utils.bytearray.ByteArrayInterface
All Implemented Interfaces:
Reusable
Direct Known Subclasses:
ByteArray, ByteArrayBuffer

public abstract class ByteArrayInterface extends Object implements Reusable
Title:

Description:

Copyright: Copyright (c) 2009

Company:

Version:
1.0
Author:
not attributable
  • Field Details

    • data

      public byte[] data
      Container of information.
    • offset

      public int offset
      Offset of this byte array.
    • length

      public int length
      Current length of this byte array.
    • hashBuffer

      protected int[] hashBuffer
      Contains the calculated hash code of this instance.
  • Constructor Details

    • ByteArrayInterface

      public ByteArrayInterface()
  • Method Details

    • copy

      public abstract ByteArrayInterface copy(byte[] a)
    • copy

      public abstract ByteArrayInterface copy(byte[] a, int p_offset, int p_length)
    • copy

      public abstract ByteArrayInterface copy(String data)
    • append

      public abstract ByteArrayInterface append(byte[] a)
    • append

      public abstract ByteArrayInterface append(byte[] a, int p_offset, int p_length)
    • append

      public abstract ByteArrayInterface append(ByteArrayInterface a)
    • append

      public abstract ByteArrayInterface append(char ch)
    • append

      public abstract ByteArrayInterface append(char... str)
    • append

      public abstract ByteArrayInterface append(byte b)
    • append

      public abstract ByteArrayInterface append(int n)
    • append

      public abstract ByteArrayInterface append(String str)
    • appendRandomHexChars

      public abstract ByteArrayInterface appendRandomHexChars(int length)
    • appendAsHexString

      public abstract ByteArrayInterface appendAsHexString(byte[] data, int offset, int length)
    • getLength

      public abstract int getLength()
    • toString

      public abstract String toString()
      Overrides:
      toString in class Object
    • reset

      public abstract void reset()
      Description copied from interface: Reusable
      Reset all the parameter of the instance to the initial value, so that it can be reused without any problem.
      Specified by:
      reset in interface Reusable
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(byte[] data, int offset, int length)
      Check if the given byte array is equal to this instance or not.
      Parameters:
      data - current instance data will be compared with this array.
      offset - starting index of parameter byte array to be compared.
      length - length of the parameter byte array to be compared.
      Returns:
      true, if the given byte array matched with data, otherwise, return false.