Giter VIP home page Giter VIP logo

bytestream's Introduction

bytestream

c++内存字节流。

C++ bytestream in memory.

license

是大家都喜欢的MIT

It's a MIT that everyone likes

使用简单 Easy to use

导入import:

bytestream.h
bytestream.cpp

参考consult:

main.cpp
#include "bytestream.h"

//每个bucket的大小8字节,测试bucket分片工作是否正常所以设置的数值小,正常情况下bucket的大小应该根据业务场景设置
//也可以不设置bucket大小,默认1024

//The size of each bucket is 8 bytes. Test whether the bucket sharding is working properly, so the set value is small. Normally, the size of the bucket should be set according to the business scenario
//You can also choose not to set the bucket size, which defaults to 1024
mc::ByteStream* bs = new mc::ByteStream(8);

//write
std::string testText = "12345678abcdefgh!@#$%^&*";
bs->write(testText.c_str(), testText.size());

//read
char* data = (char*)calloc(1024, sizeof(char));
mc::BS_DSIZE readsize = bs->read(data, 1024);

std::string readText = data;
std::cout << readText << std::endl;

delete data;

//delete
delete bs;

bytestream's People

Contributors

mountcloud avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.