示例#1
0
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;
}
示例#2
0
bool BinaryFile::writeTo(const ByteArray& byteArray) throw()
{
    write(this->fileSignature, byteArray.getBytes(), byteArray.getLength());
    return true;
}