D
David McDivitt
With Java I must read a file written in VB. The file contains the following
user defined type:
Public Type ProcRec
LastScanTime As Date
NextExecuteTime As Date
NextExecuteTimeSet As Integer
MinutesToRun As Long
TaskID As Double
ID As String * 4
ProcScheduler As String * 1
ProcName As String * 30
Active As Integer
PassArguments As Integer
OwnSection As String * 4
OwnUnit As String * 4
Executable As String * 256
ExecutableType As Integer
TextOffset(60, 1) As Long
End Type
The fixed length data structure is written at the front of the file as a
header. The remainder of the file contains variable length text, with
offsets and lengths contained in the TextOffset array. TextOffset is zero
based having 61 x 2 elements.
I looked at the BufferredReader and FileInputStream classes. They will read
into a character array, but I have to define the character array size before
the read. I could make an array having exceptional size to make sure it's
big enough, but I want a method which will return a character array having
the exact size of the file.
If someone has code to convert the numeric values I'd appreciate it. Would
save a little time but I can do that. Thanks
user defined type:
Public Type ProcRec
LastScanTime As Date
NextExecuteTime As Date
NextExecuteTimeSet As Integer
MinutesToRun As Long
TaskID As Double
ID As String * 4
ProcScheduler As String * 1
ProcName As String * 30
Active As Integer
PassArguments As Integer
OwnSection As String * 4
OwnUnit As String * 4
Executable As String * 256
ExecutableType As Integer
TextOffset(60, 1) As Long
End Type
The fixed length data structure is written at the front of the file as a
header. The remainder of the file contains variable length text, with
offsets and lengths contained in the TextOffset array. TextOffset is zero
based having 61 x 2 elements.
I looked at the BufferredReader and FileInputStream classes. They will read
into a character array, but I have to define the character array size before
the read. I could make an array having exceptional size to make sure it's
big enough, but I want a method which will return a character array having
the exact size of the file.
If someone has code to convert the numeric values I'd appreciate it. Would
save a little time but I can do that. Thanks