Package com.webcodepro.shrinkit
Class ThreadRecord
- java.lang.Object
-
- com.webcodepro.shrinkit.ThreadRecord
-
public class ThreadRecord extends java.lang.Object
This represents a single thread from the Shrinkit archive. As it is constructed, the thread "header" is read. Once all threads have been constructed, usereadThreadData
to load up the data.Depending on the type of thread, the data may be text. If so,
isText
will return true andgetText
will return the string. Otherwise the data should be read through one of theInputStream
options.
-
-
Constructor Summary
Constructors Constructor Description ThreadRecord(HeaderBlock hb, LittleEndianByteInputStream bs)
Construct the ThreadRecord and read the header details.ThreadRecord(LittleEndianByteInputStream bs)
Construct the ThreadRecord and read the header details with no hints from the Header Block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes()
Get raw data bytes (compressed).long
getCompThreadEof()
java.io.InputStream
getInputStream()
Get the appropriate input data stream for this thread to decompress the contents.java.io.InputStream
getRawInputStream()
Get the raw data input stream.java.lang.String
getText()
Return the text data.ThreadClass
getThreadClass()
int
getThreadCrc()
byte[]
getThreadData()
long
getThreadEof()
ThreadFormat
getThreadFormat()
ThreadKind
getThreadKind()
boolean
isText()
Determine if this is a text-type field.void
readThreadData(LittleEndianByteInputStream bs)
Read the raw thread data.void
setCompThreadEof(long compThreadEof)
void
setThreadClass(ThreadClass threadClass)
void
setThreadCrc(int threadCrc)
void
setThreadData(byte[] threadData)
void
setThreadEof(long threadEof)
void
setThreadFormat(ThreadFormat threadFormat)
void
setThreadKind(ThreadKind threadKind)
-
-
-
Constructor Detail
-
ThreadRecord
public ThreadRecord(LittleEndianByteInputStream bs) throws java.io.IOException
Construct the ThreadRecord and read the header details with no hints from the Header Block.- Throws:
java.io.IOException
-
ThreadRecord
public ThreadRecord(HeaderBlock hb, LittleEndianByteInputStream bs) throws java.io.IOException
Construct the ThreadRecord and read the header details.- Throws:
java.io.IOException
-
-
Method Detail
-
readThreadData
public void readThreadData(LittleEndianByteInputStream bs) throws java.io.IOException
Read the raw thread data. This must be called.- Throws:
java.io.IOException
-
isText
public boolean isText()
Determine if this is a text-type field.
-
getText
public java.lang.String getText()
Return the text data.
-
getBytes
public byte[] getBytes()
Get raw data bytes (compressed).
-
getRawInputStream
public java.io.InputStream getRawInputStream()
Get the raw data input stream.
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Get the appropriate input data stream for this thread to decompress the contents.- Throws:
java.io.IOException
-
getThreadClass
public ThreadClass getThreadClass()
-
setThreadClass
public void setThreadClass(ThreadClass threadClass)
-
getThreadFormat
public ThreadFormat getThreadFormat()
-
setThreadFormat
public void setThreadFormat(ThreadFormat threadFormat)
-
getThreadKind
public ThreadKind getThreadKind()
-
setThreadKind
public void setThreadKind(ThreadKind threadKind)
-
getThreadCrc
public int getThreadCrc()
-
setThreadCrc
public void setThreadCrc(int threadCrc)
-
getThreadEof
public long getThreadEof()
-
setThreadEof
public void setThreadEof(long threadEof)
-
getCompThreadEof
public long getCompThreadEof()
-
setCompThreadEof
public void setCompThreadEof(long compThreadEof)
-
getThreadData
public byte[] getThreadData()
-
setThreadData
public void setThreadData(byte[] threadData)
-
-