Package jmri.jmrix.loconet.spjfile
Class SpjFile.Header
java.lang.Object
jmri.jmrix.loconet.spjfile.SpjFile.Header
- Direct Known Subclasses:
SpjFile.FirstHeader
- Enclosing class:
- SpjFile
Class representing a header record.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[](package private) int(package private) int(package private) String(package private) int(package private) static final int(package private) int(package private) int(package private) SdfBuffer(package private) int(package private) int(package private) int(package private) int(package private) int(package private) int(package private) int(package private) int(package private) int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]intintintgetName()intGet Record Length.intGet as a SDF buffer.intgetType()booleanisMap()booleanisSDF()booleanisTxt()booleanisWAV()(package private) voidload(InputStream s) voidsetContent(byte[] array, int start, int length) Provide new content.voidsetDataStart(int i) voidvoidsetRecordLength(int i) voidsetRecordStart(int i) (package private) intstore(byte[] buffer, int index) (package private) voidtoString()(package private) voidupdateStart(int newRecordStart) Data record associated with this header is being being repositioned.
-
Field Details
-
HEADERSIZE
- See Also:
-
type
int type -
handle
int handle -
recordStart
int recordStart -
dataStart
int dataStart -
dataLength
int dataLength -
recordLength
int recordLength -
time
int time -
spare1
int spare1 -
spare2
int spare2 -
spare3
int spare3 -
spare4
int spare4 -
spare5
int spare5 -
spare6
int spare6 -
spare7
int spare7 -
filename
-
bytes
byte[] bytes -
sdfBuffer
-
-
Constructor Details
-
Header
public Header()
-
-
Method Details
-
getType
-
getHandle
-
getDataStart
-
setDataStart
-
getDataLength
-
getRecordStart
-
setRecordStart
-
getRecordLength
Get Record Length.This method, in addition to returning the needed record size, will also pull a SdfBuffer back into the record if one exists.
- Returns:
- record length.
-
setRecordLength
-
getName
-
setName
-
getByteArray
-
getSdfBuffer
Get as a SDF buffer. This buffer then becomes associated, and a later write will use the buffer's contents.- Returns:
- the byte array as SDF buffer.
-
updateStart
Data record associated with this header is being being repositioned.- Parameters:
newRecordStart- identify the new start record
-
setContent
Provide new content. The data start and data length values are computed from the arguments, and stored relative to the length.- Parameters:
array- New byte array; copied into headerstart- data start location within arraylength- data length in bytes (not record length)
-
store
-
store
- Throws:
IOException
-
load
- Throws:
IOException
-
toString
-
isWAV
-
isSDF
-
isMap
-
isTxt
-
typeAsString
-