定制 cyndaron/binary-handler 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cyndaron/binary-handler

最新稳定版本:v3

Composer 安装命令:

composer require cyndaron/binary-handler

包简介

Read and write binary files easily

README 文档

README

Simple project to read and write binary files in PHP.

Background

The project was created out of a desire to have a solution that was a bit simpler than mdurrant’s Binary Reader, and which supported writing binary files. Some of the differences:

  • This project only works on whole bytes. You will have to do any bitmasking yourself.
  • This project allows writing binary files, in addition to reading them.
  • This project allows creating the reader and writer from a filename, in addition to a string or a resource.

Which one is the best fit for your project will depend on your use cases, obviously.

Usage

Both the BinaryReader and BinaryWriter take a resource. Helper functions are provided to create them from an already existing string or from a filename.

Extending

The project is set up with extensibility in mind, as it is very well possible you’ll want to be able to read or write structures specific to your file type. You can quite easily build your own reader/writer using the provided traits and interfaces - even the default BinaryReader and BinaryWriter classes are only built using these.

Future plans

  • Adding a test suite.

统计信息

  • 总下载量: 274
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-17