Fix a bug in file payload.

PiperOrigin-RevId: 640494382
This commit is contained in:
Edwin Wu
2024-06-05 05:43:02 -07:00
committed by Copybara-Service
parent 334ef7a3e1
commit 152cabab7c
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ namespace nearby {
namespace connections {
enum class PayloadType { kUnknown = 0, kBytes = 1, kFile = 2, kStream = 3 };
enum PayloadDirection {
enum class PayloadDirection {
UNKNOWN_DIRECTION_PAYLOAD = 0,
INCOMING_PAYLOAD = 1,
OUTGOING_PAYLOAD = 2,
@@ -14,7 +14,6 @@
#include "internal/platform/implementation/shared/file.h"
#include <algorithm>
#include <cstddef>
#include <ios>
#include <memory>
@@ -37,7 +36,7 @@ IOFile::IOFile(const absl::string_view file_path, size_t size)
: file_(std::string(file_path.data(), file_path.size()),
std::ios::binary | std::ios::in | std::ios::ate),
path_(file_path),
total_size_(file_.tellg()) {
total_size_(size) {
file_.seekg(0);
}