MCPcopy Create free account
hub / github.com/apache/arrow / WritePaddedBlank

Function WritePaddedBlank

cpp/src/arrow/ipc/feather.cc:130–142  ·  view source on GitHub ↗

For compatibility, we need to write any data sometimes just to keep producing files that can be read with an older reader.

Source from the content-addressed store, hash-verified

128/// For compatibility, we need to write any data sometimes just to keep producing
129/// files that can be read with an older reader.
130Status WritePaddedBlank(io::OutputStream* stream, int64_t length,
131 int64_t* bytes_written) {
132 const uint8_t null = 0;
133 for (int64_t i = 0; i < length; i++) {
134 RETURN_NOT_OK(stream->Write(&null, 1));
135 }
136 int64_t remainder = PaddedLength(length) - length;
137 if (remainder != 0) {
138 RETURN_NOT_OK(stream->Write(kPaddingBytes, remainder));
139 }
140 *bytes_written = length + remainder;
141 return Status::OK();
142}
143
144// ----------------------------------------------------------------------
145// ReaderV1

Callers 1

WriteBufferMethod · 0.85

Calls 3

PaddedLengthFunction · 0.70
OKFunction · 0.50
WriteMethod · 0.45

Tested by

no test coverage detected