2 #ifndef vsl_b_read_block_old_h_ 3 #define vsl_b_read_block_old_h_ 15 #include <vxl_config.h> 16 #include <vcl_compiler_detection.h> 18 # include <vcl_msvc_warnings.h> 28 #include <vcl_deprecated.h> 41 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
54 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
55 is.
is().read((
char*) begin, (
unsigned long)(nelems*
sizeof(
double)));
67 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
68 is.
is().read((
char*) begin, (
unsigned long)(nelems*
sizeof(
float)));
82 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
89 is.
is().read(block, nbytes);
90 std::size_t n_bytes_converted =
93 if (n_bytes_converted != nbytes)
95 std::cerr <<
"\nI/O ERROR: vsl_b_read_block(.., int*,..) :\n" 96 <<
" Corrupted data stream\n";
97 is.
is().clear(std::ios::badbit);
113 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
119 is.
is().read(block, nbytes);
120 std::size_t n_bytes_converted =
123 if (n_bytes_converted != nbytes)
125 std::cerr <<
"\nI/O ERROR: vsl_b_read_block(.., unsigned int*,..) :\n" 126 <<
" Corrupted data stream\n";
127 is.
is().clear(std::ios::badbit);
144 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
150 is.
is().read(block, nbytes);
151 std::size_t n_bytes_converted =
154 if (n_bytes_converted != nbytes)
156 std::cerr <<
"\nI/O ERROR: vsl_b_read_block(.., short*,..) :\n" 157 <<
" Corrupted data stream\n";
158 is.
is().clear(std::ios::badbit);
175 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
181 is.
is().read(block, nbytes);
182 std::size_t n_bytes_converted =
185 if (n_bytes_converted != nbytes)
187 std::cerr <<
"\nI/O ERROR: vsl_b_read_block(.., unsigned short*,..) :\n" 188 <<
" Corrupted data stream\n";
189 is.
is().clear(std::ios::badbit);
206 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
212 is.
is().read(block, nbytes);
213 std::size_t n_bytes_converted =
216 if (n_bytes_converted != nbytes)
218 std::cerr <<
"\nI/O ERROR: vsl_b_read_block(.., long*,..) :\n" 219 <<
" Corrupted data stream\n";
220 is.
is().clear(std::ios::badbit);
237 VXL_DEPRECATED_MACRO(
"vsl_b_read_block_old()" );
243 is.
is().read(block, nbytes);
244 std::size_t n_bytes_converted =
247 if (n_bytes_converted != nbytes)
249 std::cerr <<
"\nI/O ERROR: vsl_b_read_block(.., unsigned long*,..) :\n" 250 <<
" Corrupted data stream\n";
251 is.
is().clear(std::ios::badbit);
256 #endif // vsl_b_read_block_old_h_ void vsl_swap_bytes(char *ptr, unsigned nbyte, std::size_t nelem=1)
Perform byte swapping in situ.
Byte-swapping, arbitrary length integer conversion, and explicit I/O.
std::istream & is() const
A reference to the adaptor's stream.
std::size_t vsl_convert_from_arbitrary_length(const unsigned char *buffer, unsigned long *ints, std::size_t count=1)
Decode a buffer of arbitrary length integers.
void vsl_b_read_block_old(vsl_b_istream &is, T *begin, std::size_t nelems)
Read a block of values from a vsl_b_istream.
#define VSL_MAX_ARBITRARY_INT_BUFFER_LENGTH(size_of_type)
The maximum length of buffer to use with arbitrary length integers.
void vsl_b_read(vsl_b_istream &is, char &n)
Read char from vsl_b_istream.
An adaptor for any std::istream to make it suitable for binary input.
Set of functions, and objects to perform binary IO.