byteblock
Class ByteBlockMaskedWindow

java.lang.Object
  |
  +--byteblock.ByteBlockWindow
        |
        +--byteblock.ByteBlockRectangularWindow
              |
              +--byteblock.ByteBlockMaskedWindow

public class ByteBlockMaskedWindow
extends ByteBlockRectangularWindow

Extends ByteBlockRectangularWindow to include a mask specifying only those bits in each byte which will be read or written (corresponding to the positions of 1's in the mask byte).


Fields inherited from class byteblock.ByteBlockRectangularWindow
baseStartIndex, numCols, numRows
 
Fields inherited from class byteblock.ByteBlockWindow
baseBlock
 
Constructor Summary
ByteBlockMaskedWindow(ByteBlock block, byte mask)
          Create a window for the specified ByteBlock which uses the specified mask.
ByteBlockMaskedWindow(int baseStartIndex, int numRows, int numCols, ByteBlock block, byte mask)
          Create a rectangular window into the specified ByteBlock using the specified mask.
 
Method Summary
 void clearBytes(int startIndex, int endIndex)
          Set all bytes in window from (and including) startByte to (and excluding) endByte to 0x00, masking with this instance's byte mask.
 byte[] getBytes(int startIndex, int endIndex)
          Return the sequence of bytes in the window between the specified indices, masking each with this instance's byte mask.
 java.lang.String toHexString(int startIndex, int endIndex)
          Return a String representing the bytes in the window between the specified indices, masked with this instance's byte mask, without spaces between pairs of hex digits.
 java.lang.String toString(int startIndex, int endIndex)
          Return a String representing the bytes in the window between the specified indices, masked with this instance's byte mask, with spaces between pairs of hex digits.
 void writeBytes(int startIndex, byte[] byteString)
          Write a sequence of bytes into the window, starting at the specified index and masking with this instance's byte mask.
 
Methods inherited from class byteblock.ByteBlockRectangularWindow
clearBytes, getBytes, getSize, toHexString, toString, writeBytes
 
Methods inherited from class byteblock.ByteBlockWindow
getHex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteBlockMaskedWindow

public ByteBlockMaskedWindow(ByteBlock block,
                             byte mask)
Create a window for the specified ByteBlock which uses the specified mask.

ByteBlockMaskedWindow

public ByteBlockMaskedWindow(int baseStartIndex,
                             int numRows,
                             int numCols,
                             ByteBlock block,
                             byte mask)
Create a rectangular window into the specified ByteBlock using the specified mask. The resulting window will have the specified number of rows and columns, and will start at the specified index of the base block.
Method Detail

getBytes

public byte[] getBytes(int startIndex,
                       int endIndex)
Return the sequence of bytes in the window between the specified indices, masking each with this instance's byte mask.
Overrides:
getBytes in class ByteBlockRectangularWindow

clearBytes

public void clearBytes(int startIndex,
                       int endIndex)
Set all bytes in window from (and including) startByte to (and excluding) endByte to 0x00, masking with this instance's byte mask.
Overrides:
clearBytes in class ByteBlockRectangularWindow

writeBytes

public void writeBytes(int startIndex,
                       byte[] byteString)
Write a sequence of bytes into the window, starting at the specified index and masking with this instance's byte mask. Note that this automatically clears all the other bytes - masked, of course.
Overrides:
writeBytes in class ByteBlockRectangularWindow

toString

public java.lang.String toString(int startIndex,
                                 int endIndex)
Return a String representing the bytes in the window between the specified indices, masked with this instance's byte mask, with spaces between pairs of hex digits.
Overrides:
toString in class ByteBlockRectangularWindow

toHexString

public java.lang.String toHexString(int startIndex,
                                    int endIndex)
Return a String representing the bytes in the window between the specified indices, masked with this instance's byte mask, without spaces between pairs of hex digits.
Overrides:
toHexString in class ByteBlockRectangularWindow