code: public static int encode(byte[] value, int valueOffset, int valueLength,
                               byte[] dst, int dstOffset) {
          return encode(value, valueOffset, valueLength, dst, dstOffset, 0);
      }
docs: Encodes the given optional unsigned byte array into a variable amount of
  bytes. If the byte array is null, exactly 1 byte is written. Otherwise,
  the amount written can be determined by calling calculateEncodedLength.
  
  @param value byte array value to encode, may be null
  @param valueOffset offset into byte array
  @param valueLength length of data in byte array
  @param dst destination for encoded bytes
  @param dstOffset offset into destination array
  @return amount of bytes written