Class NufxLzw2InputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class NufxLzw2InputStream
    extends java.io.InputStream
    The NufxLzw2InputStream reads a data fork or resource fork written in the NuFX LZW/2 format.

    The layout of the LZW/2 data is as follows:

    "Fork" Header
    +0 Byte Low-level volume number used to format 5.25" disks
    +1 Byte RLE character used to decode this thread
    Each subsequent 4K chunk of data
    +0 Word Bits 0-12: Length after RLE compression
    Bit 15: LZW flag (set to 1 if LZW used)
    +2 Word If LZW flag = 1, total bytes in chunk
    Else (flag = 0) start of data

    The LZW/2 dictionary is only cleared when the table becomes full and is indicated in the input stream by 0x100. It is also cleared whenever a chunk that is not LZW encoded is encountered.

      • Constructor Summary

    Constructors 
    Constructor Description
    NufxLzw2InputStream​(LittleEndianByteInputStream dataStream)
    Create the LZW/2 input stream.
  • Method Summary

    All Methods Instance Methods Concrete Methods 
    Modifier and Type Method Description
    long getDataCrc()  
    int getRleCharacter()  
    int getVolumeNumber()  
    int read()
    Read the next byte in the decompressed data stream.
    void setRleCharacter​(int rleCharacter)  
    void setVolumeNumber​(int volumeNumber)  
    • Methods inherited from class java.io.InputStream

      available, close, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
    • Methods inherited from class java.lang.Object

      clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • read

        public int read()
                 throws java.io.IOException
        Read the next byte in the decompressed data stream.
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • getVolumeNumber

        public int getVolumeNumber()
      • setVolumeNumber

        public void setVolumeNumber​(int volumeNumber)
      • getRleCharacter

        public int getRleCharacter()
      • setRleCharacter

        public void setRleCharacter​(int rleCharacter)
      • getDataCrc

        public long getDataCrc()