java.lang.Object
com.blackhillsoftware.zutil.io.RecordWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
TextRecordWriter
This class wraps
com.ibm.jzos.RecordWriter
and implements java.io.Closeable
,
allowing you to use the RecordWriter with a try-with-resources block.
This class provides the same methods as JZOS RecordWriter and calls the
JZOS RecordWriter methods so it should be a drop in replacement to JZOS RecordWriter,
with the addition of the Closeable
interface.-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the underlyingcom.ibm.jzos.RecordWriter
void
flush()
Wrapper forcom.ibm.jzos.RecordWriter.flush()
boolean
Wrapper forcom.ibm.jzos.RecordWriter.getAutoFree()
int
Wrapper forcom.ibm.jzos.RecordWriter.getBlksize()
Wrapper forcom.ibm.jzos.RecordWriter.getDDName()
getDsn()
Wrapper forcom.ibm.jzos.RecordWriter.getDsn()
int
getLrecl()
Wrapper forcom.ibm.jzos.RecordWriter.getLrecl()
getRecfm()
Wrapper forcom.ibm.jzos.RecordWriter.getRecfm()
int
Wrapper forcom.ibm.jzos.RecordWriter.getRecfmBits()
static RecordWriter
Construct a newcom.blackhillsoftware.zutil.io.RecordWriter
using the same syntax ascom.ibm.jzos.RecordWriter.newWriter(String name, int flags)
static RecordWriter
newWriterForDD
(String ddname) Construct a newcom.blackhillsoftware.zutil.io.RecordWriter
using the same syntax ascom.ibm.jzos.RecordWriter.newWriterForDD(String ddname)
void
setAutoFree
(boolean autoFree) void
write
(byte[] buf) Wrapper forcom.ibm.jzos.RecordWriter.write(byte[] buf)
void
write
(byte[] buf, int offset, int len)
-
Method Details
-
newWriter
Construct a newcom.blackhillsoftware.zutil.io.RecordWriter
using the same syntax ascom.ibm.jzos.RecordWriter.newWriter(String name, int flags)
- Parameters:
name
- the name of the file to openflags
-- Returns:
- Throws:
IOException
- if the JZOS native call fails
-
newWriterForDD
Construct a newcom.blackhillsoftware.zutil.io.RecordWriter
using the same syntax ascom.ibm.jzos.RecordWriter.newWriterForDD(String ddname)
- Throws:
IOException
- if the JZOS native call fails
-
close
Close the underlyingcom.ibm.jzos.RecordWriter
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- if the JZOS native call fails
-
flush
Wrapper forcom.ibm.jzos.RecordWriter.flush()
- Throws:
IOException
- if the JZOS native call fails
-
getAutoFree
public boolean getAutoFree()Wrapper forcom.ibm.jzos.RecordWriter.getAutoFree()
-
setAutoFree
public void setAutoFree(boolean autoFree) -
getBlksize
public int getBlksize()Wrapper forcom.ibm.jzos.RecordWriter.getBlksize()
-
getDDName
Wrapper forcom.ibm.jzos.RecordWriter.getDDName()
-
getDsn
Wrapper forcom.ibm.jzos.RecordWriter.getDsn()
-
getLrecl
public int getLrecl()Wrapper forcom.ibm.jzos.RecordWriter.getLrecl()
-
getRecfm
Wrapper forcom.ibm.jzos.RecordWriter.getRecfm()
-
getRecfmBits
public int getRecfmBits()Wrapper forcom.ibm.jzos.RecordWriter.getRecfmBits()
- Returns:
- result of JZOS RecordWriter.getRecfmBits()
-
write
Wrapper forcom.ibm.jzos.RecordWriter.write(byte[] buf)
- Throws:
IOException
- if the JZOS native call fails
-
write
- Throws:
IOException
- if the JZOS native call fails
-