3#ifdef ROSE_ENABLE_BINARY_ANALYSIS
5#include <Rose/BinaryAnalysis/ByteOrder.h>
17 rose_addr_t offset{header->get_offset()};
20 size_t count = header->readContent(offset, &length,
sizeof(length));
21 if (count !=
sizeof(length)) {
23 ROSE_ASSERT(
false &&
"Error reading JVM bytes array length");
27 header->set_offset(offset);
30 bytes =
new char[length];
33 count = header->readContent(offset, bytes, length);
34 if (count != length) {
36 ROSE_ASSERT(
false &&
"Error reading JVM bytes array");
39 header->set_offset(offset);
48 rose_addr_t offset{header->get_offset()};
50 size_t count = header->readContent(offset, &value,
sizeof(T));
51 if (count !=
sizeof(T)) {
53 ROSE_ASSERT(
false &&
"Error reading JVM value");
56 if (advanceOffset) header->set_offset(offset + count);
61void writeValue(std::ostream& os, T value)
64 os.write(
reinterpret_cast<const char*
>(&value),
sizeof value);
SgAsmGenericHeader *const & get_header() const
Property: File header that owns this section.
Represents an JVM constant pool.
void hostToBe(const Source &src, Destination *dst, typename std::enable_if< std::is_integral< Source >::value &&std::is_integral< Destination >::value >::type *=nullptr)
Convert host order to big-endian.
std::enable_if< std::is_integral< T >::value, T >::type beToHost(const T &x)
Convert a big-endian integer to host order.