File: IInOutStreams.cc

package info (click to toggle)
apngasm 2.91-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,760 kB
  • sloc: ansic: 34,259; cpp: 7,258; makefile: 40
file content (25 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "Portable.h"
#include "IInOutStreams.h"

HRESULT ISequentialInStream::Read(void *aData, INT aSize, INT* aProcessedSize) {
	if (aSize > size)
		aSize = size;
	*aProcessedSize = aSize;
	memcpy(aData, data, aSize);
	size -= aSize;
	data += aSize;
	return S_OK;
}

HRESULT ISequentialOutStream::Write(const void *aData, INT aSize, INT* aProcessedSize) {
	if (aSize > size) {
		overflow = true;
		aSize = size;
	}
	*aProcessedSize = aSize;
	memcpy(data, aData, aSize);
	size -= aSize;
	data += aSize;
	total += aSize;
	return S_OK;
}