Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Java class that represents a bit pattern in two's complement representation.
Java
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
nbproject
src/util/binary
README.mkdn
build.xml

README.mkdn

BitPattern

A Java class that represents a bit pattern in two's complement representation.

Most of the standard bit pattern operations are supported:

  • Addition
  • Bitwise NOT
  • Bitwise AND
  • Bitwise OR
  • Bitwise XOR
  • Rotation
  • Arithmetic shifting

The class was created to be used for byte representations so the default constructor sets the length to 8. It should work for bit patterns of arbitrary length if integers are replaced by instances of BigInteger (currently, if the value exceeds Integer.MAX_VALUE/MIN_VALUE it will throw an Exception).

License

Copyright (c) 2010 Georgios Migdos.

The source code is available under the terms of the Apache license v2.0

Something went wrong with that request. Please try again.