GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lok0613/elixir-binary-reader

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
test
test
 
 
.formatter.exs
.formatter.exs
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
mix.exs
mix.exs
 
 
mix.lock
mix.lock
 
 

Repository files navigation

BinaryReader

A Elixir Binary Reader that running WITH side effects.

Installation

def deps do
  [
    {:binary_reader, "~> 0.1.0"}
  ]
end

Usage

Normal Usage

iex> {:ok, pid} = BinaryReader.start_link(<<65, 66, 67, 68, 2, 0, 0, 0>>)
{:ok, #PID<0.0.0>}
iex> BinaryReader.read_string(pid)
"ABCD"
iex> BinaryReader.remains_byte_size(pid)
4
iex> BinaryReader.read_int32(pid)
2
iex> BinaryReader.stop(pid)
:ok

Extend BinaryReader

defmodule SpecialBinaryReader do
  use BinaryReader

  def special_read(pid) do
    length = read_int32(pid)
    read_bytes(pid, length)
  end
end

iex> {:ok, pid} = SpecialBinaryReader.start_link(<<.....>>)
iex> SpecialBinaryReader.special_read(pid)

About

No description or website provided.

Topics

binary-readerelixir

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.