diff --git a/.gitignore b/.gitignore
index 6148c38..ba334df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,3 +60,4 @@
 /test-suite.log
 /test/*.gcda
 /test/*.gcno
+/test/libpldm_fileio_test
diff --git a/Makefile.am b/Makefile.am
index d2456ab..e2a2d96 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1 @@
-SUBDIRS = libpldm
+SUBDIRS = libpldm test
diff --git a/configure.ac b/configure.ac
index 6c9895c..88c4d9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,27 @@
 # For linking
 LT_INIT
 
+# Check/set gtest specific functions.
+AX_PTHREAD([GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"],[GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=0"])
+AC_SUBST(GTEST_CPPFLAGS)
+AC_ARG_ENABLE([oe-sdk],
+    AS_HELP_STRING([--enable-oe-sdk], [Link testcases absolutely against OE SDK so they can be ran within it.])
+)
+AC_ARG_VAR(OECORE_TARGET_SYSROOT,
+    [Path to the OE SDK SYSROOT])
+AS_IF([test "x$enable_oe_sdk" == "xyes"],
+    AS_IF([test "x$OECORE_TARGET_SYSROOT" == "x"],
+          AC_MSG_ERROR([OECORE_TARGET_SYSROOT must be set with --enable-oe-sdk])
+    )
+    AC_MSG_NOTICE([Enabling OE-SDK at $OECORE_TARGET_SYSROOT])
+    [
+        testcase_flags="-Wl,-rpath,\${OECORE_TARGET_SYSROOT}/lib"
+        testcase_flags="${testcase_flags} -Wl,-rpath,\${OECORE_TARGET_SYSROOT}/usr/lib"
+        testcase_flags="${testcase_flags} -Wl,-dynamic-linker,`find \${OECORE_TARGET_SYSROOT}/lib/ld-*.so | sort -r -n | head -n1`"
+    ]
+    AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
+)
+
 # Create configured output
-AC_CONFIG_FILES([Makefile libpldm/Makefile])
+AC_CONFIG_FILES([Makefile libpldm/Makefile test/Makefile])
 AC_OUTPUT
diff --git a/libpldm/Makefile.am b/libpldm/Makefile.am
index 59da344..d837608 100644
--- a/libpldm/Makefile.am
+++ b/libpldm/Makefile.am
@@ -1,7 +1,11 @@
+nobase_include_HEADERS = \
+	file_io.h
+
 libpldmoem_LTLIBRARIES = libpldmoem.la
 libpldmoemdir = ${libdir}
 libpldmoem_la_SOURCES = \
-	base.c
+	base.c \
+	file_io.c
 
 libpldmoem_la_LDFLAGS = \
         -version-info 1:0:0 -shared
diff --git a/libpldm/file_io.c b/libpldm/file_io.c
new file mode 100644
index 0000000..426033a
--- /dev/null
+++ b/libpldm/file_io.c
@@ -0,0 +1,53 @@
+#include "file_io.h"
+#include <endian.h>
+#include <string.h>
+
+int decode_read_file_memory_req(const uint8_t *msg, size_t payload_length,
+				uint32_t *file_handle, uint32_t *offset,
+				uint32_t *length, uint64_t *address)
+{
+	if (msg == NULL || file_handle == NULL || offset == NULL ||
+	    length == NULL || address == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_READ_FILE_MEM_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	*file_handle = le32toh(*((uint32_t *)msg));
+	*offset = le32toh(*((uint32_t *)(msg + sizeof(*file_handle))));
+	*length = le32toh(
+	    *((uint32_t *)(msg + sizeof(*file_handle) + sizeof(*offset))));
+	*address = le64toh(*((uint64_t *)(msg + sizeof(*file_handle) +
+					  sizeof(*offset) + sizeof(*length))));
+
+	return PLDM_SUCCESS;
+}
+
+int encode_read_file_memory_resp(uint8_t instance_id, uint8_t completion_code,
+				 uint32_t length, struct pldm_msg *msg)
+{
+	struct pldm_header_info header = {0};
+	int rc = PLDM_SUCCESS;
+
+	uint8_t *payload = msg->payload;
+	*payload = completion_code;
+
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_IBM_OEM_TYPE;
+	header.command = PLDM_READ_FILE_INTO_MEMORY;
+
+	if ((rc = pack_pldm_header(&header, &(msg->hdr))) > PLDM_SUCCESS) {
+		return rc;
+	}
+
+	if (msg->payload[0] == PLDM_SUCCESS) {
+		uint8_t *dst = msg->payload + sizeof(completion_code);
+		length = htole32(length);
+		memcpy(dst, &length, sizeof(length));
+	}
+
+	return PLDM_SUCCESS;
+}
diff --git a/libpldm/file_io.h b/libpldm/file_io.h
new file mode 100644
index 0000000..c273608
--- /dev/null
+++ b/libpldm/file_io.h
@@ -0,0 +1,64 @@
+#ifndef FILEIO_H
+#define FILEIO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base.h"
+
+#define PLDM_IBM_OEM_TYPE 0x3F
+
+/** @brief PLDM Commands in IBM OEM type
+ */
+enum pldm_fileio_commands { PLDM_READ_FILE_INTO_MEMORY = 0x6 };
+
+/** @brief PLDM Command specific codes
+ */
+enum pldm_fileio_completion_codes {
+	PLDM_INVALID_FILE_HANDLE = 0x80,
+	PLDM_DATA_OUT_OF_RANGE = 0x81,
+	PLDM_INVALID_READ_LENGTH = 0x82
+};
+
+#define PLDM_READ_FILE_MEM_REQ_BYTES 20
+#define PLDM_READ_FILE_MEM_RESP_BYTES 5
+
+/* ReadFileIntoMemory */
+
+/** @brief Decode ReadFileIntoMemory commands request data
+ *
+ *  @param[in] msg - Pointer to PLDM request message payload
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] offset - Offset to the file at which the read should begin
+ *  @param[out] length - Number of bytes to be read
+ *  @param[out] address - Memory address where the file content has to be
+ *                        written to
+ *  @return pldm_completion_codes
+ */
+int decode_read_file_memory_req(const uint8_t *msg, size_t payload_length,
+				uint32_t *file_handle, uint32_t *offset,
+				uint32_t *length, uint64_t *address);
+
+/** @brief Create a PLDM response for ReadFileIntoMemory
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in] length - Number of bytes read. This could be less than what the
+			 requester asked for.
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_read_file_memory_resp(uint8_t instance_id, uint8_t completion_code,
+				 uint32_t length, struct pldm_msg *msg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FILEIO_H */
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..f854cec
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,27 @@
+AM_CPPFLAGS = -I$(top_srcdir)
+
+TESTS = $(check_PROGRAMS)
+
+check_PROGRAMS = \
+        libpldm_fileio_test
+
+test_cppflags = \
+	-Igtest \
+	$(GTEST_CPPFLAGS) \
+	$(AM_CPPFLAGS)
+
+test_cxxflags = \
+	$(PTHREAD_CFLAGS)
+
+test_ldflags = \
+	-lgtest_main \
+	-lgtest \
+	$(PTHREAD_LIBS) \
+	$(OESDK_TESTCASE_FLAGS)
+
+libpldm_fileio_test_CPPFLAGS = $(test_cppflags)
+libpldm_fileio_test_CXXFLAGS = $(test_cxxflags)
+libpldm_fileio_test_LDFLAGS = $(test_ldflags)
+libpldm_fileio_test_LDADD = $(top_builddir)/libpldm/base.o \
+                            $(top_builddir)/libpldm/file_io.o
+libpldm_fileio_test_SOURCES = libpldm_fileio_test.cpp
diff --git a/test/libpldm_fileio_test.cpp b/test/libpldm_fileio_test.cpp
new file mode 100644
index 0000000..4968d39
--- /dev/null
+++ b/test/libpldm_fileio_test.cpp
@@ -0,0 +1,104 @@
+#include <string.h>
+
+#include <array>
+
+#include "libpldm/base.h"
+#include "libpldm/file_io.h"
+
+#include <gtest/gtest.h>
+
+TEST(ReadFileIntoMemory, testGoodDecodeRequest)
+{
+    std::array<uint8_t, PLDM_READ_FILE_MEM_REQ_BYTES> requestMsg{};
+
+    // Random value for fileHandle, offset, length, address
+    uint32_t fileHandle = 0x12345678;
+    uint32_t offset = 0x87654321;
+    uint32_t length = 0x13245768;
+    uint64_t address = 0x124356879ACBDE0F;
+
+    memcpy(requestMsg.data(), &fileHandle, sizeof(fileHandle));
+    memcpy(requestMsg.data() + sizeof(fileHandle), &offset, sizeof(offset));
+    memcpy(requestMsg.data() + sizeof(fileHandle) + sizeof(offset), &length,
+           sizeof(length));
+    memcpy(requestMsg.data() + sizeof(fileHandle) + sizeof(offset) +
+               sizeof(length),
+           &address, sizeof(address));
+
+    uint32_t retFileHandle = 0;
+    uint32_t retOffset = 0;
+    uint32_t retLength = 0;
+    uint64_t retAddress = 0;
+
+    // Invoke decode the read file memory request
+    auto rc = decode_read_file_memory_req(requestMsg.data(), requestMsg.size(),
+                                          &retFileHandle, &retOffset,
+                                          &retLength, &retAddress);
+
+    ASSERT_EQ(rc, PLDM_SUCCESS);
+    ASSERT_EQ(fileHandle, retFileHandle);
+    ASSERT_EQ(offset, retOffset);
+    ASSERT_EQ(length, retLength);
+    ASSERT_EQ(address, retAddress);
+}
+
+TEST(ReadFileIntoMemory, testBadDecodeRequest)
+{
+    uint32_t fileHandle = 0;
+    uint32_t offset = 0;
+    uint32_t length = 0;
+    uint64_t address = 0;
+
+    // Request payload message is missing
+    auto rc = decode_read_file_memory_req(NULL, 0, &fileHandle, &offset,
+                                          &length, &address);
+    ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+    std::array<uint8_t, PLDM_READ_FILE_MEM_REQ_BYTES> requestMsg{};
+
+    // Address is NULL
+    rc = decode_read_file_memory_req(requestMsg.data(), requestMsg.size(),
+                                     &fileHandle, &offset, &length, NULL);
+    ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+    // Payload length is invalid
+    rc = decode_read_file_memory_req(requestMsg.data(), 0, &fileHandle, &offset,
+                                     &length, &address);
+    ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadFileIntoMemory, testGoodEncodeResponse)
+{
+    std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_READ_FILE_MEM_RESP_BYTES>
+        responseMsg{};
+    uint32_t length = 0xFF00EE11;
+    pldm_msg* response = reinterpret_cast<pldm_msg*>(responseMsg.data());
+
+    auto rc = encode_read_file_memory_resp(0, PLDM_SUCCESS, length, response);
+
+    ASSERT_EQ(rc, PLDM_SUCCESS);
+    ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+    ASSERT_EQ(response->hdr.instance_id, 0);
+    ASSERT_EQ(response->hdr.type, PLDM_IBM_OEM_TYPE);
+    ASSERT_EQ(response->hdr.command, PLDM_READ_FILE_INTO_MEMORY);
+    ASSERT_EQ(response->payload[0], PLDM_SUCCESS);
+    ASSERT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]),
+                        &length, sizeof(length)));
+}
+
+TEST(ReadFileIntoMemory, testBadEncodeResponse)
+{
+    std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_READ_FILE_MEM_RESP_BYTES>
+        responseMsg{};
+    uint32_t length = 0;
+    pldm_msg* response = reinterpret_cast<pldm_msg*>(responseMsg.data());
+
+    auto rc = encode_read_file_memory_resp(0, PLDM_ERROR, length, response);
+
+    ASSERT_EQ(rc, PLDM_SUCCESS);
+    ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+    ASSERT_EQ(response->hdr.instance_id, 0);
+    ASSERT_EQ(response->hdr.type, PLDM_IBM_OEM_TYPE);
+    ASSERT_EQ(response->hdr.command, PLDM_READ_FILE_INTO_MEMORY);
+    ASSERT_EQ(response->payload[0], PLDM_ERROR);
+}
