Class NufxLzw1InputStream

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

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

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

    "Fork" Header
    +0 Word CRC-16 of the uncompressed data within the thread
    +2 Byte Low-level volume number use to format 5.25" disks
    +3 Byte RLE character used to decode this thread
    Each subsequent 4K chunk of data
    +0 Word Length after RLE compression (if RLE is not used, length will be 4096
    +2 Byte A $01 indicates LZW applied to this chunk; $00 that LZW was not applied to this chunk

    Note that the LZW string table is cleared after every chunk.

      • Constructor Summary

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

    All Methods Instance Methods Concrete Methods 
    Modifier and Type Method Description
    long getDataCrc()  
    int getGivenCrc()  
    int getRleCharacter()  
    int getVolumeNumber()  
    boolean isCrcValid()
    Indicates if the computed CRC matches the CRC given in the data stream.
    int read()
    Read the next byte in the decompressed data stream.
    void setGivenCrc​(int givenCrc)  
    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
      • isCrcValid

        public boolean isCrcValid()
        Indicates if the computed CRC matches the CRC given in the data stream.
      • getGivenCrc

        public int getGivenCrc()
      • setGivenCrc

        public void setGivenCrc​(int givenCrc)
      • getVolumeNumber

        public int getVolumeNumber()
      • setVolumeNumber

        public void setVolumeNumber​(int volumeNumber)
      • getRleCharacter

        public int getRleCharacter()
      • setRleCharacter

        public void setRleCharacter​(int rleCharacter)
      • getDataCrc

        public long getDataCrc()