Class ReversedBitsChannel

java.lang.Object
org.apache.sis.storage.geotiff.ReversedBitsChannel
All Implemented Interfaces:
Closeable, AutoCloseable, ByteChannel, Channel, ReadableByteChannel, SeekableByteChannel, WritableByteChannel

final class ReversedBitsChannel extends Object implements ReadableByteChannel, SeekableByteChannel
A channel with a read(…) method fetching all bytes with theirs bits in reverse order. For example, byte 11010100 will become 00101011. The use of this class should be very rare.
Since:
1.1
Version:
1.1
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final ChannelDataInput
    Source channel where to read bytes before bit order reversal.
    private static final byte[]
    Lookup table for reversing the order of bits in a byte.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Creates a new channel which will reverse the bit order of bytes read from the given channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Do nothing.
    final boolean
    Tells whether this channel is still open.
    long
    Returns the current stream position.
    position(long p)
    Moves to the specified stream position.
    int
    read(ByteBuffer target)
    Reads a sequence of bytes from this channel into the given buffer.
    long
    Implemented as a matter of principle, but not needed in the context of TIFF reader.
    truncate(long size)
    Unsupported operation (for now).
    private static IOException
    unsupported(String operation)
    Creates the exception to throw for an unsupported operation.
    (package private) static ChannelDataInput
    Creates a new input channel at the same position and with the same content than the given channel, but with bits order reversed in every byte.
    int
    write(ByteBuffer source)
    Unsupported operation (for now).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait