Skip to content

ByteBuffer provides a stream-like read/write interface for byte array. 提供串流方式存取位元組陣列的類別。

License

Notifications You must be signed in to change notification settings

seanzhengw/ByteBuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ByteBuffer

ByteBuffer provides a stream-like read/write interface for byte array.

Feature

  • Stream interface read/write ByteBuffer.
  • Passing ByteBuffer easily with it's own properties.
  • Copy ByteBuffer easily with a = operator.
  • DynamicByteBuffer for runtime resizable buffer.
  • StaticByteBuffer for compile time size buffer.

Quickstart

// create DynamicByteBuffer with 64 bytes capacity.
DynamicByteBuffer buf(64);

// Write byte
buf.Write('a');

// Write bytes, length 5.
uint8_t byte_array[8] = {0, 1, 2, 3, 4, 5, 6, 7};
buf.Write(byte_array, 5)

// Write string
const char* c_str = "abc"
buf.Write(c_str);

// Read byte
uint8_t b = buf.Read();

// Read bytes, length 5.
uint8_t byte_array2[5];
buf.Read(byte_array2, 5);

see examples for using ByteBuffer in Arduino platform.

Benchmark

See Benchmark.md for details.

About

ByteBuffer provides a stream-like read/write interface for byte array. 提供串流方式存取位元組陣列的類別。

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published