GithubHelp home page GithubHelp logo

jfoshee / unpluggedibmbits Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 5.0 1011 KB

C# Library for reading legacy IBM formatted bits like EBCDIC, big endian and floating point

Home Page: https://nuget.org/packages/Unplugged.IbmBits

License: Other

C# 100.00%

unpluggedibmbits's Introduction

Legacy IBM Data Reading Library in C#

MIT License NuGet Build status

Helps read/write and convert between legacy IBM System formats and .NET types. Includes IbmConverter class as well as BinaryReader & BinaryWriter extensions for EBCDIC string, Big Endian Int16, Big Endian Int32 and IBM System/360 single precision floating point format.

Issues welcome. Do not fold, spindle, or mutilate.

Example of using BinaryReader extension methods

using System.IO;
using Unplugged.IbmBits;
using (var stream = File.OpenRead("punchcard.bin"))
using (var reader = new BinaryReader(stream))
{
    string text = reader.ReadStringEbcdic(12);
    float f = reader.ReadSingleIbm();
    int i16 = reader.ReadInt16BigEndian();
    int i32 = reader.ReadInt32BigEndian();
}

Example of using BinaryWriter extension methods

    using (var stream = File.OpenWrite("punchcard.bin"))
    using (var writer = new BinaryWriter(stream))
    {
        writer.WriteEbcdic("Hello, World");
        writer.WriteIbmSingle(3.14f);
        writer.WriteBigEndian((Int16) 13);
        writer.WriteBigEndian((Int32) 54321);
    }

unpluggedibmbits's People

Contributors

gimmemoore avatar jfoshee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unpluggedibmbits's Issues

IBMConverter.ToSingle overflow

An error seems to have appeared since version 0.0.0.4 that causes some floats to be interpreted as +/- infinity in IbmConverter.ToSingle()

byte exponentBits = value[0]; // byte can overflow

I tested using these bytes [ 191, 201, 78, 71 ]

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.