View Source ExDicom.Alloc (EX_DICOM v0.1.0)

Module containing helper functions for working with binary data in DICOM parsing.

Summary

Functions

Creates a new binary of the specified length filled with zeros.

Functions

zeros(length)

@spec zeros(non_neg_integer()) :: {:ok, binary()} | {:error, String.t()}

Creates a new binary of the specified length filled with zeros.

Parameters

  • length - The desired length of the new binary in bytes

Returns

  • {:ok, binary} - A new zero-filled binary of the specified length
  • {:error, String.t()} - Error message if the input is invalid

Examples

iex> ExDicom.Alloc.zeros(3)
{:ok, <<0, 0, 0>>}