bool BitmapData::initWithFile(const std::string &path) { _filePath = FileUtils::getInstance()->getFullPath(path); ByteArray *data = FileUtils::getInstance()->getFileData(_filePath, "rb"); bool result = false; if (!data->isNull()) { result = initWithData(data->getBytes(), data->getLength()); } delete data; return result; }
bool BinaryFile::writeTo(const ByteArray& byteArray) throw() { write(this->fileSignature, byteArray.getBytes(), byteArray.getLength()); return true; }