Module jcifs

Class ByteEncodable

java.lang.Object
org.codelibs.jcifs.smb.util.ByteEncodable
All Implemented Interfaces:
Encodable

public class ByteEncodable extends Object implements Encodable
Interface for objects that can be encoded to byte arrays. Provides standardized method for converting objects to their binary representation.
Author:
mbechler
  • Constructor Summary

    Constructors
    Constructor
    Description
    ByteEncodable(byte[] b, int off, int len)
    Constructs a ByteEncodable object wrapping a byte array segment.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    encode(byte[] dst, int dstIndex)
    Encodes this object into the specified byte array.
    int
    Returns the size in bytes that this object will occupy when encoded.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteEncodable

      public ByteEncodable(byte[] b, int off, int len)
      Constructs a ByteEncodable object wrapping a byte array segment.
      Parameters:
      b - the byte array to wrap
      off - the offset in the byte array
      len - the length of the segment to use
  • Method Details

    • size

      public int size()
      Returns the size in bytes that this object will occupy when encoded.
      Specified by:
      size in interface Encodable
      Returns:
      the encoded size
      See Also:
    • encode

      public int encode(byte[] dst, int dstIndex)
      Encodes this object into the specified byte array.
      Specified by:
      encode in interface Encodable
      Parameters:
      dst - the destination byte array to encode into
      dstIndex - the starting index in the destination array
      Returns:
      encoded length
      See Also: