Package com.webcodepro.shrinkit.io
Class LittleEndianByteOutputStream
java.lang.Object
java.io.OutputStream
com.webcodepro.shrinkit.io.LittleEndianByteOutputStream
- All Implemented Interfaces:
- ByteConstants,- Closeable,- Flushable,- AutoCloseable
An OutputStream with helper methods to write little endian numbers
 and other Apple-specific tidbits.
- 
Field SummaryFields inherited from interface com.webcodepro.shrinkit.io.ByteConstantsBXY_ID, NUFILE_ID, NUFX_ID, TIMEREC_DAY, TIMEREC_HOUR, TIMEREC_LENGTH, TIMEREC_MINUTE, TIMEREC_MONTH, TIMEREC_NULL, TIMEREC_SECOND, TIMEREC_WEEKDAY, TIMEREC_YEAR
- 
Constructor SummaryConstructorsConstructorDescriptionLittleEndianByteOutputStream(OutputStream outputStream) Construct a LittleEndianByteOutputStream from an OutputStream.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Pass the close request to the wrapped stream.voidflush()Pass the flush request to the wrapped stream.longGet the current CRC-16 value.longAnswer with the total number of bytes written.voidresetCrc()Reset the CRC-16 to $0000.voidwrite(int b) Write a next byte.voidWrite the Java Date object as a TimeRec.voidwriteLong(long l) Write a "Long".voidWrite the NuFile id to the LittleEndianByteOutputStream.voidWrite the NuFX id to the LittleEndianByteOutputStream.voidwriteWord(int w) Write a "Word".Methods inherited from class java.io.OutputStreamnullOutputStream, write, write
- 
Constructor Details- 
LittleEndianByteOutputStreamConstruct a LittleEndianByteOutputStream from an OutputStream.
 
- 
- 
Method Details- 
writeWrite a next byte.- Specified by:
- writein class- OutputStream
- Throws:
- IOException
 
- 
writeNuFileIdWrite the NuFile id to the LittleEndianByteOutputStream.- Throws:
- IOException
 
- 
writeNuFxIdWrite the NuFX id to the LittleEndianByteOutputStream.- Throws:
- IOException
 
- 
writeWordWrite a "Word".- Throws:
- IOException
 
- 
writeLongWrite a "Long".- Throws:
- IOException
 
- 
writeDateWrite the Java Date object as a TimeRec. Note that years 2000-2039 are assumed to be 00-39 per the NuFX addendum.- Throws:
- IOException
- See Also:
 
- 
resetCrcpublic void resetCrc()Reset the CRC-16 to $0000.
- 
getCrcValuepublic long getCrcValue()Get the current CRC-16 value.
- 
getTotalBytesWrittenpublic long getTotalBytesWritten()Answer with the total number of bytes written.
- 
flushPass the flush request to the wrapped stream.- Specified by:
- flushin interface- Flushable
- Overrides:
- flushin class- OutputStream
- Throws:
- IOException
 
- 
closePass the close request to the wrapped stream.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- OutputStream
- Throws:
- IOException
 
 
-