com.dalsemi.onewire.utils
Class Bit
java.lang.Object
|
+--com.dalsemi.onewire.utils.Bit
- public class Bit
- extends Object
Utilities for bit operations on an array.
- Version:
- 0.00, 27 August 2000
- Author:
- DS
Constructor Summary |
Bit()
|
Method Summary |
static int |
arrayReadBit(int index,
int offset,
byte[] buf)
Read a bit state in a byte array. |
static void |
arrayWriteBit(int state,
int index,
int offset,
byte[] buf)
Write the bit state in a byte array. |
Bit
public Bit()
arrayWriteBit
public static void arrayWriteBit(int state,
int index,
int offset,
byte[] buf)
- Write the bit state in a byte array.
- Parameters:
state
- new state of the bit 1, 0index
- bit index into byte arrayoffset
- byte offset into byte array to startbuf
- byte array to manipulate
arrayReadBit
public static int arrayReadBit(int index,
int offset,
byte[] buf)
- Read a bit state in a byte array.
- Parameters:
index
- bit index into byte arrayoffset
- byte offset into byte array to startbuf
- byte array to read from- Returns:
- bit state 1 or 0
Copyright © 1999-2003 Dallas Semiconductor. All Rights Reserved.