Top Description Fields Constructors Methods
org.hsqldb.lib.tar

public Class PIFGenerator

extends ByteArrayOutputStream
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .File, .IOException, .OutputStreamWriter, java.nio.charset.Charset, .StandardCharsets, java.util.Date

Encapsulates Pax Interchange Format key-value pairs.

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv String
pack-priv OutputStreamWriter
Inherited from java.io.ByteArrayOutputStream:
bufcount

Constructor Summary

AccessConstructor and Description
protected
public
PIFGenerator(int
Index starts at 1 in each Tar file
sequenceNum
)

Construct a PIFGenerator object for a 'g' record.

public
PIFGenerator(File
Target file of the x record.
file
)

Construct a PIFGenerator object for a 'x' record.

Method Summary

Modifier and TypeMethod and Description
public void
addRecord(String
String
key
,
boolean
boolean value
b
)

Convenience wrapper for addRecord(String, String).

public void
addRecord(String
String
key
,
int
int value
i
)

Convenience wrapper for addRecord(String, String).

public void
addRecord(String
String
key
,
long
long value
l
)

Convenience wrapper for addRecord(String, String).

public void
addRecord(String
String
key
,
String
String
value
)

I guess the "initial length" field is supposed to be in units of characters, not bytes?

public String
Inherited from java.io.ByteArrayOutputStream:
closeresetsizetoByteArraytoStringtoStringtoStringtoStringwritewritewriteByteswriteTo

Field Detail

fakePidback to summary
pack-priv int fakePid
nameback to summary
pack-priv String name
writerback to summary
pack-priv OutputStreamWriter writer

Constructor Detail

PIFGeneratorback to summary
protected PIFGenerator()
PIFGeneratorback to summary
public PIFGenerator(int sequenceNum)

Construct a PIFGenerator object for a 'g' record.

Parameters
sequenceNum:int

Index starts at 1 in each Tar file

PIFGeneratorback to summary
public PIFGenerator(File file)

Construct a PIFGenerator object for a 'x' record.

Parameters
file:File

Target file of the x record.

Method Detail

addRecordback to summary
public void addRecord(String key, boolean b) throws TarMalformatException, IOException

Convenience wrapper for addRecord(String, String). N.b. this writes values exactly as either "true" or "false".

Parameters
key:String

String

b:boolean

boolean value

Exceptions
TarMalformatException:
if there is a problem writing the tar file
IOException:
if there is an IO problem
See Also
addRecord(String, String), Boolean#toString(boolean)
addRecordback to summary
public void addRecord(String key, int i) throws TarMalformatException, IOException

Convenience wrapper for addRecord(String, String).

Parameters
key:String

String

i:int

int value

Exceptions
TarMalformatException:
if there is a problem writing the tar file
IOException:
IOException if there is an IO problem
See Also
addRecord(String, String)
addRecordback to summary
public void addRecord(String key, long l) throws TarMalformatException, IOException

Convenience wrapper for addRecord(String, String).

Parameters
key:String

String

l:long

long value

Exceptions
TarMalformatException:
if there is a problem writing the tar file
IOException:
if there is an IO problem
See Also
addRecord(String, String)
addRecordback to summary
public void addRecord(String key, String value) throws TarMalformatException, IOException

I guess the "initial length" field is supposed to be in units of characters, not bytes?

Parameters
key:String

String

value:String

String

Exceptions
TarMalformatException:
if there is a problem writing the tar file
IOException:
if there is an IO problem
getNameback to summary
public String getName()