Package jmri.jmrix.pricom.downloader
Class PdiFile
- java.lang.Object
-
- jmri.jmrix.pricom.downloader.PdiFile
-
public class PdiFile extends java.lang.Object
Support for reading PRICOM ".pdi" filesThe PRICOM format documentation is Copyright 2003, 2005, PRICOM Corp. They have kindly given permission for this use.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intaddress(package private) java.lang.Stringcomment(package private) intcommentLength(package private) java.io.Filefile(package private) intfileLength(package private) intlastAddress
-
Constructor Summary
Constructors Constructor Description PdiFile(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetComment()Return the comment embedded at the front of the file.byte[]getNext(int n)Get the next n bytes for transmission to the device(package private) intlength()voidopen()voidopen(java.io.InputStream stream)
-
-
-
Field Detail
-
file
java.io.File file
-
comment
java.lang.String comment
-
commentLength
int commentLength
-
lastAddress
int lastAddress
-
address
int address
-
fileLength
int fileLength
-
-
Constructor Detail
-
PdiFile
public PdiFile(java.io.File file)
-
-
Method Detail
-
open
public void open() throws java.io.IOException
- Throws:
java.io.IOException
-
open
public void open(java.io.InputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
getComment
public java.lang.String getComment()
Return the comment embedded at the front of the file.- Returns:
- file comment.
-
length
int length()
-
getNext
public byte[] getNext(int n)
Get the next n bytes for transmission to the device- Parameters:
n- number of data bytes to include- Returns:
- byte buffer, starting with address info and containing data, but not CRC
-
-