Class XdrHashCode


public class XdrHashCode extends XdrEncodingStream

Title: common - XdrHashCode provides ...

Description: calculate HashCode by using XdrAble.xdrEncode(XdrEncodingStream)

  • Field Details

    • result

      protected int result
  • Constructor Details

    • XdrHashCode

      public XdrHashCode()
  • Method Details

    • xdrEncodeInt

      public void xdrEncodeInt(int value) throws OncRpcException, IOException
      Description copied from class: XdrEncodingStream
      Encodes (aka "serializes") a "XDR int" value and writes it down a XDR stream. A XDR int is 32 bits wide -- the same width Java's "int" data type has. This method is one of the basic methods all other methods can rely on. Because it's so basic, derived classes have to implement it.
      Specified by:
      xdrEncodeInt in class XdrEncodingStream
      Parameters:
      value - The int value to be encoded.
      Throws:
      OncRpcException - if an ONC/RPC error occurs.
      IOException - if an I/O error occurs.
    • xdrEncodeOpaque

      public void xdrEncodeOpaque(byte[] value, int offset, int length) throws OncRpcException, IOException
      Description copied from class: XdrEncodingStream
      Encodes (aka "serializes") a XDR opaque value, which is represented by a vector of byte values, and starts at offset with a length of length. Only the opaque value is encoded, but no length indication is preceeding the opaque value, so the receiver has to know how long the opaque value will be. The encoded data is always padded to be a multiple of four. If the given length is not a multiple of four, zero bytes will be used for padding.

      Derived classes must ensure that the proper semantic is maintained.

      Specified by:
      xdrEncodeOpaque in class XdrEncodingStream
      Parameters:
      value - The opaque value to be encoded in the form of a series of bytes.
      offset - Start offset in the data.
      length - the number of bytes to encode.
      Throws:
      OncRpcException - if an ONC/RPC error occurs.
      IOException - if an I/O error occurs.
    • getResult

      public int getResult()
    • hashCode

      public static int hashCode(XdrAble xa)