| 236 | } |
| 237 | |
| 238 | void BitpackEncoder::outputRead( char *dest, const size_t byteCount ) |
| 239 | { |
| 240 | #ifdef E57_VERBOSE |
| 241 | std::cout << "BitpackEncoder::outputRead() called, dest=" << dest << " byteCount=" << byteCount |
| 242 | << std::endl; //??? |
| 243 | #endif |
| 244 | |
| 245 | // Check we have enough bytes in queue |
| 246 | if ( byteCount > outputAvailable() ) |
| 247 | { |
| 248 | throw E57_EXCEPTION2( ErrorInternal, "byteCount=" + toString( byteCount ) + |
| 249 | " outputAvailable=" + toString( outputAvailable() ) ); |
| 250 | } |
| 251 | |
| 252 | // Copy output bytes to caller |
| 253 | memcpy( dest, &outBuffer_[outBufferFirst_], byteCount ); |
| 254 | |
| 255 | #ifdef E57_VERBOSE |
| 256 | { |
| 257 | unsigned i; |
| 258 | for ( i = 0; i < byteCount && i < 20; i++ ) |
| 259 | { |
| 260 | std::cout << " outBuffer[" << outBufferFirst_ + i << "]=" |
| 261 | << static_cast<unsigned>( |
| 262 | static_cast<unsigned char>( outBuffer_[outBufferFirst_ + i] ) ) |
| 263 | << std::endl; //??? |
| 264 | } |
| 265 | |
| 266 | if ( i < byteCount ) |
| 267 | { |
| 268 | std::cout << " " << byteCount - 1 << " bytes unprinted..." << std::endl; |
| 269 | } |
| 270 | } |
| 271 | #endif |
| 272 | |
| 273 | // Advance head pointer. |
| 274 | outBufferFirst_ += byteCount; |
| 275 | |
| 276 | // Don't slide remaining data down now, wait until do some more processing (that's when data |
| 277 | // needs to be aligned). |
| 278 | } |
| 279 | |
| 280 | void BitpackEncoder::outputClear() |
| 281 | { |