📄 inputstream.cpp
字号:
#include <io/InputStream.h>
#include <assert.h>
#include <stdint.h>
#include <config.h>
namespace io
{
int InputStream::skip( int n )
{
assert( n >= 0 );
const int buffSize = 256;
uint8_t buff[buffSize];
int bytesSkipped = 0;
while ( bytesSkipped < n )
{
int bytes = n - bytesSkipped;
if ( bytes > buffSize )
bytes = buffSize;
bytes = read( buff, bytes );
bytesSkipped += bytes;
if ( 0 == bytes )
break;
}
return bytesSkipped;
}
} // io
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -