public class HFile extends Object
| Constructor and Description |
|---|
HFile(String file)
Open file for reading objects from a serialized file in sequential order.
|
HFile(String file,
String option)
Open file for reading objects from a serialized file in sequential order.
|
HFile(String file,
String option,
boolean compression)
Open a file to write/read objects to/from a serialized file in sequential
order.
|
HFile(String file,
String option,
boolean compression,
int bufferSize)
Open a file to write/read objects to/from a serialized file in sequential
order.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
close()
Close the file
|
int |
getBufferSize()
Get current buffer size for I/O.
|
int |
getEntries()
Return processed number of entries
|
Object |
read()
Get object from a file.
|
void |
setFlush(int reset)
Set after how many events data will be flushed.
|
boolean |
write(Object ob)
Add an object to a file
|
public HFile(String file, String option, boolean compression, int bufferSize)
If the file name starts from http or ftp, we assume it is located on the Web and will attempt to read it from URL.
file - File name. Can be located on URL if starts from http or ftp.option - Option to create the file. If "w" - write a file (or read)
file, if "r" only read created file.compression - if true, objects are compressed on-fly using GZIPbufferSize - set buffer size for I/O. It is best to use buffer sizes that
are multiples of 1024 bytes.public HFile(String file, String option, boolean compression)
file - File nameoption - Option to create the file. If "w" - write a file (or read)
file, if "r" only read created file.compression - if true, objects are compressed on-fly using GZIPbuffer - set buffer size for I/O. It is best to use buffer sizes that
are multiples of 1024 bytes.public HFile(String file)
file - File namepublic int getBufferSize()
public boolean write(Object ob)
ob - Objectkey - key for objectpublic void setFlush(int reset)
reset - after how many events data will be reset.public int getEntries()
public Object read()
public boolean close()
jHepWork 3.5 ©