1//---------------------------------------------------------------------- 2// This software is part of the OpenBeOS distribution and is covered 3// by the OpenBeOS license. 4// 5// Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net 6//---------------------------------------------------------------------- 7 8/*! \file MemoryStream.cpp 9*/ 10 11#include "MemoryStream.h" 12 13#include <stdlib.h> 14#include <string.h> 15 16MemoryStream::MemoryStream(void *buffer, size_t length) 17 : PositionIOStream(fMemory) 18 , fMemory(buffer, length) 19 , fInitStatus(buffer ? B_OK : B_NO_INIT) 20{ 21} 22 23status_t 24MemoryStream::InitCheck() const 25{ 26 status_t error = PositionIOStream::InitCheck(); 27 if (!error) 28 error = fInitStatus; 29 return error; 30} 31 32