test_class.file: leshan-core/src/test/java/org/eclipse/leshan/core/tlv/TlvEncoderTest.java
test_class.identifier: TlvEncoderTest
test_case.body: @Test
      public void encode_date() {
          long timestamp = System.currentTimeMillis();
          byte[] encoded = TlvEncoder.encodeDate(new Date(timestamp));
  
          // check value
          ByteBuffer bb = ByteBuffer.wrap(encoded);
          assertEquals((int) (timestamp / 1000), bb.getInt());
          assertEquals(0, bb.remaining());
      }
test_case.class_method_signature: TlvEncoderTest.encode_date()
test_case.full_signature: @Test public void encode_date()
test_case.identifier: encode_date
test_case.invocations: currentTimeMillis encodeDate wrap assertEquals getInt assertEquals remaining
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void encode_date()
focal_class.declarator: LOG = LoggerFactory.getLogger(TlvEncoder.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(TlvEncoder.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: MAX_LENGTH_8BIT = 256
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_LENGTH_8BIT = 256;
focal_class.type: int
focal_class.var_name: MAX_LENGTH_8BIT
focal_class.declarator: MAX_LENGTH_16BIT = 65_536
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_LENGTH_16BIT = 65_536;
focal_class.type: int
focal_class.var_name: MAX_LENGTH_16BIT
focal_class.declarator: MAX_LENGTH_24BIT = 16_777_216
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_LENGTH_24BIT = 16_777_216;
focal_class.type: int
focal_class.var_name: MAX_LENGTH_24BIT
focal_class.file: leshan-core/src/main/java/org/eclipse/leshan/core/tlv/TlvEncoder.java
focal_class.identifier: TlvEncoder
focal_class.class_method_signature: TlvEncoder.encode(Tlv[] tlvs)
focal_class.full_signature: public static ByteBuffer encode(Tlv[] tlvs)
focal_class.identifier: encode
focal_class.modifiers: public static
focal_class.parameters: (Tlv[] tlvs)
focal_class.return: ByteBuffer
focal_class.signature: ByteBuffer encode(Tlv[] tlvs)
focal_class.class_method_signature: TlvEncoder.encodeInteger(Number number)
focal_class.full_signature: public static byte[] encodeInteger(Number number)
focal_class.identifier: encodeInteger
focal_class.modifiers: public static
focal_class.parameters: (Number number)
focal_class.return: byte[]
focal_class.signature: byte[] encodeInteger(Number number)
focal_class.class_method_signature: TlvEncoder.encodeFloat(Number number)
focal_class.full_signature: public static byte[] encodeFloat(Number number)
focal_class.identifier: encodeFloat
focal_class.modifiers: public static
focal_class.parameters: (Number number)
focal_class.return: byte[]
focal_class.signature: byte[] encodeFloat(Number number)
focal_class.class_method_signature: TlvEncoder.encodeBoolean(boolean value)
focal_class.full_signature: public static byte[] encodeBoolean(boolean value)
focal_class.identifier: encodeBoolean
focal_class.modifiers: public static
focal_class.parameters: (boolean value)
focal_class.return: byte[]
focal_class.signature: byte[] encodeBoolean(boolean value)
focal_class.class_method_signature: TlvEncoder.encodeString(String value)
focal_class.full_signature: public static byte[] encodeString(String value)
focal_class.identifier: encodeString
focal_class.modifiers: public static
focal_class.parameters: (String value)
focal_class.return: byte[]
focal_class.signature: byte[] encodeString(String value)
focal_class.class_method_signature: TlvEncoder.encodeDate(Date value)
focal_class.full_signature: public static byte[] encodeDate(Date value)
focal_class.identifier: encodeDate
focal_class.modifiers: public static
focal_class.parameters: (Date value)
focal_class.return: byte[]
focal_class.signature: byte[] encodeDate(Date value)
focal_class.class_method_signature: TlvEncoder.encodeObjlnk(ObjectLink value)
focal_class.full_signature: public static byte[] encodeObjlnk(ObjectLink value)
focal_class.identifier: encodeObjlnk
focal_class.modifiers: public static
focal_class.parameters: (ObjectLink value)
focal_class.return: byte[]
focal_class.signature: byte[] encodeObjlnk(ObjectLink value)
focal_class.class_method_signature: TlvEncoder.tlvEncodedSize(Tlv tlv, int length)
focal_class.full_signature: private static int tlvEncodedSize(Tlv tlv, int length)
focal_class.identifier: tlvEncodedSize
focal_class.modifiers: private static
focal_class.parameters: (Tlv tlv, int length)
focal_class.return: int
focal_class.signature: int tlvEncodedSize(Tlv tlv, int length)
focal_class.class_method_signature: TlvEncoder.tlvEncodedLength(Tlv tlv)
focal_class.full_signature: private static int tlvEncodedLength(Tlv tlv)
focal_class.identifier: tlvEncodedLength
focal_class.modifiers: private static
focal_class.parameters: (Tlv tlv)
focal_class.return: int
focal_class.signature: int tlvEncodedLength(Tlv tlv)
focal_class.class_method_signature: TlvEncoder.encode(Tlv tlv, ByteBuffer b)
focal_class.full_signature: private static void encode(Tlv tlv, ByteBuffer b)
focal_class.identifier: encode
focal_class.modifiers: private static
focal_class.parameters: (Tlv tlv, ByteBuffer b)
focal_class.return: void
focal_class.signature: void encode(Tlv tlv, ByteBuffer b)
focal_method.body: public static byte[] encodeDate(Date value) {
          ByteBuffer tBuf = ByteBuffer.allocate(4);
          tBuf.putInt((int) (value.getTime() / 1000L));
          return tBuf.array();
      }
focal_method.class_method_signature: TlvEncoder.encodeDate(Date value)
focal_method.full_signature: public static byte[] encodeDate(Date value)
focal_method.identifier: encodeDate
focal_method.invocations: allocate putInt getTime array
focal_method.modifiers: public static
focal_method.parameters: (Date value)
focal_method.return: byte[]
focal_method.signature: byte[] encodeDate(Date value)