net.kano.joscar.rvproto.ft
Class FileTransferHeader

java.lang.Object
  extended byFileTransferHeader
All Implemented Interfaces:
LiveWritable

public final class FileTransferHeader
extends java.lang.Object
implements LiveWritable

A data structure used to transfer information over a file transfer connection.


Field Summary
static java.lang.String CLIENTID_DEFAULT
          A client ID string used by WinAIM 5.2 beta.
static java.lang.String CLIENTID_OLD
          A client ID string used by WinAIM 5.1 and earlier.
static int COMPRESSION_NONE
          An encryption code indicating that no compression is being used.
static ByteBlock DUMMY_DEFAULT
          The "dummy" block sent by WinAIM.
static int ENCRYPTION_NONE
          An encryption code indicating that no encryption is being used.
static int FLAG_DEFAULT
          A flag that is always sent by WinAIM.
static int FLAG_DONE
          A flag sent in a HEADERTYPE_RECEIVED header.
static int FLAG_FILELIST
          A flag sent in a HEADERTYPE_FILELIST_SENDLIST header.
static java.lang.String FTVERSION_DEFAULT
          The file transfer protocol version used by WinAIM.
static int HEADERTYPE_ACK
          A header typing indicating that a header is an "acknowledgement" header.
static int HEADERTYPE_FILELIST_ACK
          A header typed used in Get File to acknowledge that a file list is about to be sent.
static int HEADERTYPE_FILELIST_RECEIVED
          A header type used in Get File to indicate that a file list was received successfully.
static int HEADERTYPE_FILELIST_REQDIR
          A header type used in Get File to request a directory listing for a specific directory.
static int HEADERTYPE_FILELIST_REQFILE
          A header type used in Get File to request a file.
static int HEADERTYPE_FILELIST_SENDLIST
          A header type used in Get File indicating that a file list is about to be sent.
static int HEADERTYPE_RECEIVED
          A header type indicating that a header is a "transfer finished" header.
static int HEADERTYPE_RESUME
          A header type indicating that the header is requesting that a file be "resumed" from a point in the file up to which the receiver has already received data.
static int HEADERTYPE_RESUME_ACK
          A header type used to indicate that the sender can begin sending the resumed file.
static int HEADERTYPE_RESUME_SENDHEADER
          A header type indicating that the sender is about to send ("resume") the file being resumed.
static int HEADERTYPE_SENDHEADER
          A header type indicating that a header is a "sending file" header.
static int LISTNAMEOFFSET_DEFAULT
          The value always sent by WinAIM for the listNameOffset field.
static int LISTSIZEOFFSET_DEFAULT
          The value always sent by WinAIM for the listSizeOffset field.
static ByteBlock MACFILEINFO_DEFAULT
          The Mac file information block sent by WinAIM.
 
Constructor Summary
FileTransferHeader()
          Creates a new file transfer header with all values initialized to either null or -1, depending on type.
FileTransferHeader(FileTransferHeader other)
          Creates a new file transfer header with the same properties as the given header.
 
Method Summary
 long getBytesReceived()
          Returns the number of bytes received for the file being transferred.
 long getChecksum()
          Returns a checksum of the file being transferred.
 java.lang.String getClientid()
          Returns the file transfer client ID string sent in this header.
 int getCompression()
          Returns a code describing the compression being used to transfer a file.
 long getCreated()
          Returns the creation date of the file being transferred, in seconds since the unix epoch.
 ByteBlock getDummyBlock()
          Returns the value of the (sigh) 69-byte "dummy block" sent in this command.
 int getEncryption()
          Returns a code describing the encryption being used to transfer a file.
 int getFileCount()
          Returns the total number of files being transferred, or in the case of transferring a file list, the total number of files in the following file list.
 SegmentedFilename getFilename()
          Returns an object representing the filename sent in this header.
 long getFileSize()
          Returns the size of the file currently being sent.
 int getFilesLeft()
          Returns the number of files (of the total number) that remain to be sent.
 int getFlags()
          Returns the set of bit flags sent in this header.
 java.lang.String getFtVersion()
          Returns the file transfer protocol version string contained in this header.
 int getHeaderSize()
          Returns the size, in bytes, of this header, or -1 if this header was not read from an incoming block of binary data.
 int getHeaderType()
          Returns a code describing which type of header this is.
 long getIcbmMessageId()
          Returns an ICBM message ID associated with this file transfer header.
 long getLastmod()
          Returns the last modification date of the file being sent, in seconds since the unix epoch.
 int getListNameOffset()
          Returns the "list name offset" sent in this header.
 int getListSizeOffset()
          Returns the "list size offset" sent in this header.
 ByteBlock getMacFileInfo()
          Returns the Mac file information block sent in this command.
 int getPartCount()
          Returns the total number of file "parts" being sent.
 int getPartsLeft()
          Returns the number of "parts" (of the total number that remain to be sent.
 long getReceivedChecksum()
          Returns a checksum of the data received for the current file.
 long getResForkChecksum()
          Returns a checksum of the MacOS resource fork for the file being transferred.
 long getResForkReceivedChecksum()
          Returns a checksum of the received MacOS resource fork data.
 long getResForkSize()
          Returns the size of the MacOS resource fork of the file being transferred.
 long getTotalFileSize()
          Returns the total file size of all files being sent.
static FileTransferHeader readHeader(java.io.InputStream in)
          Reads a file transfer header from the given stream.
 void setBytesReceived(long bytesReceived)
          Sets the number of bytes received in the current transfer.
 void setChecksum(long checksum)
          Sets the checksum of the file currently being transferred.
 void setClientid(java.lang.String clientid)
          Sets the file transfer client ID string for this header.
 void setCompression(int compression)
          Sets this header's encryption mode to the given value.
 void setCreated(long created)
          Sets the creation date of the file being sent, or 0 for none.
 void setDefaults()
          Sets all fields in this header (except filename and headerType) to a set of default values.
 void setDummyBlock(ByteBlock dummyBlock)
          Sets this header's "dummy block" value.
 void setEncryption(int encryption)
          Sets this header's encryption mode to the given value.
 void setFileCount(int fileCount)
          Sets the total file count for this header.
 void setFilename(SegmentedFilename filename)
          Sets this header's filename value.
 void setFileSize(long fileSize)
          Sets this header's value for the size of the file currently being transferred.
 void setFilesLeft(int filesLeft)
          Sets this header's "number of files remaining to be sent" value.
 void setFlags(int flags)
          Sets this header's bit flags.
 void setFtVersion(java.lang.String ftVersion)
          Sets the file transfer protocol version string for this header.
 void setHeaderType(int headerType)
          Sets this header's header type.
 void setIcbmMessageId(long icbmMessageId)
          Sets this header's ICBM message ID.
 void setLastmod(long lastmod)
          Sets the last modification date of the file being transferred, in seconds since the unix epoch, or 0 for none.
 void setListNameOffset(int listNameOffset)
          Sets the value of the "list name offset" in this header.
 void setListSizeOffset(int listSizeOffset)
          Sets the value of the "list size offset" in this header.
 void setMacFileInfo(ByteBlock macFileInfo)
          Sets this header's Mac file information block.
 void setPartCount(int partCount)
          Sets the total file part count for this header.
 void setPartsLeft(int partsLeft)
          Sets this header's "number of parts remaining to be sent" value.
 void setReceivedChecksum(long receivedChecksum)
          Sets the value of the checksum of the data received.
 void setResForkChecksum(long resForkChecksum)
          Sets the value of the checksum of the MacOS "resource fork" being transferred.
 void setResForkReceivedChecksum(long resForkReceivedChecksum)
          Sets the value of the checksum of the received portion of the MacOS "resource fork" being sent.
 void setResForkSize(long resForkSize)
          Sets the size of the MacOS "resource fork" being sent.
 void setTotalFileSize(long totalFileSize)
          Sets the total cumulative size of all files being transferred.
 java.lang.String toString()
           
 void write(java.io.OutputStream out)
          Writes this header to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FTVERSION_DEFAULT

public static final java.lang.String FTVERSION_DEFAULT
The file transfer protocol version used by WinAIM.

See Also:
Constant Field Values

HEADERTYPE_SENDHEADER

public static final int HEADERTYPE_SENDHEADER
A header type indicating that a header is a "sending file" header.

See Also:
Constant Field Values

HEADERTYPE_ACK

public static final int HEADERTYPE_ACK
A header typing indicating that a header is an "acknowledgement" header.

See Also:
Constant Field Values

HEADERTYPE_RECEIVED

public static final int HEADERTYPE_RECEIVED
A header type indicating that a header is a "transfer finished" header.

See Also:
Constant Field Values

HEADERTYPE_RESUME

public static final int HEADERTYPE_RESUME
A header type indicating that the header is requesting that a file be "resumed" from a point in the file up to which the receiver has already received data.

See Also:
Constant Field Values

HEADERTYPE_RESUME_SENDHEADER

public static final int HEADERTYPE_RESUME_SENDHEADER
A header type indicating that the sender is about to send ("resume") the file being resumed.

See Also:
Constant Field Values

HEADERTYPE_RESUME_ACK

public static final int HEADERTYPE_RESUME_ACK
A header type used to indicate that the sender can begin sending the resumed file.

See Also:
Constant Field Values

HEADERTYPE_FILELIST_SENDLIST

public static final int HEADERTYPE_FILELIST_SENDLIST
A header type used in Get File indicating that a file list is about to be sent.

See Also:
Constant Field Values

HEADERTYPE_FILELIST_ACK

public static final int HEADERTYPE_FILELIST_ACK
A header typed used in Get File to acknowledge that a file list is about to be sent.

See Also:
Constant Field Values

HEADERTYPE_FILELIST_RECEIVED

public static final int HEADERTYPE_FILELIST_RECEIVED
A header type used in Get File to indicate that a file list was received successfully.

See Also:
Constant Field Values

HEADERTYPE_FILELIST_REQFILE

public static final int HEADERTYPE_FILELIST_REQFILE
A header type used in Get File to request a file.

See Also:
Constant Field Values

HEADERTYPE_FILELIST_REQDIR

public static final int HEADERTYPE_FILELIST_REQDIR
A header type used in Get File to request a directory listing for a specific directory.

See Also:
Constant Field Values

ENCRYPTION_NONE

public static final int ENCRYPTION_NONE
An encryption code indicating that no encryption is being used.

See Also:
Constant Field Values

COMPRESSION_NONE

public static final int COMPRESSION_NONE
An encryption code indicating that no compression is being used.

See Also:
Constant Field Values

CLIENTID_OLD

public static final java.lang.String CLIENTID_OLD
A client ID string used by WinAIM 5.1 and earlier.

See Also:
Constant Field Values

CLIENTID_DEFAULT

public static final java.lang.String CLIENTID_DEFAULT
A client ID string used by WinAIM 5.2 beta.

See Also:
Constant Field Values

LISTNAMEOFFSET_DEFAULT

public static final int LISTNAMEOFFSET_DEFAULT
The value always sent by WinAIM for the listNameOffset field.

See Also:
setListNameOffset(int), Constant Field Values

LISTSIZEOFFSET_DEFAULT

public static final int LISTSIZEOFFSET_DEFAULT
The value always sent by WinAIM for the listSizeOffset field.

See Also:
setListSizeOffset(int), Constant Field Values

FLAG_DEFAULT

public static final int FLAG_DEFAULT
A flag that is always sent by WinAIM.

See Also:
Constant Field Values

FLAG_DONE

public static final int FLAG_DONE
A flag sent in a HEADERTYPE_RECEIVED header.

See Also:
Constant Field Values

FLAG_FILELIST

public static final int FLAG_FILELIST
A flag sent in a HEADERTYPE_FILELIST_SENDLIST header.

See Also:
Constant Field Values

DUMMY_DEFAULT

public static final ByteBlock DUMMY_DEFAULT
The "dummy" block sent by WinAIM.


MACFILEINFO_DEFAULT

public static final ByteBlock MACFILEINFO_DEFAULT
The Mac file information block sent by WinAIM.

Constructor Detail

FileTransferHeader

public FileTransferHeader()
Creates a new file transfer header with all values initialized to either null or -1, depending on type.

See Also:
setDefaults()

FileTransferHeader

public FileTransferHeader(FileTransferHeader other)
Creates a new file transfer header with the same properties as the given header.

Parameters:
other - a header to copy
Method Detail

readHeader

public static FileTransferHeader readHeader(java.io.InputStream in)
                                     throws java.io.IOException
Reads a file transfer header from the given stream. Note that this method will return null if no valid header can be read or if the end of the stream is reached before a valid header can be read. Also note that this method will block until a complete header is read or until one of the situations mentioned above occurs.

Parameters:
in - the stream from which to read the header
Returns:
a file transfer header read from the given stream, or null if none could be read
Throws:
java.io.IOException - if an I/O error occurs

getFtVersion

public java.lang.String getFtVersion()
Returns the file transfer protocol version string contained in this header. This will normally be FTVERSION_DEFAULT.

Returns:
the file transfer protocol version string contained in this header

getHeaderType

public int getHeaderType()
Returns a code describing which type of header this is. This will normally be one of the HEADERTYPE_* constants defined in this class.

Returns:
this header's header type code

getIcbmMessageId

public long getIcbmMessageId()
Returns an ICBM message ID associated with this file transfer header. This value is used to confirm the identity of the person on the other end of the connection; for a file transfer, this value should be the ICBM message ID of the FileSendAcceptRvCmd sent to accept the transfer. Otherwise, this value will normally be 0.

Returns:
the ICBM message ID sent in this command

getEncryption

public int getEncryption()
Returns a code describing the encryption being used to transfer a file. This will normally be ENCRYPTION_NONE (to indicate that no encryption is taking place).

Returns:
this header's encryption code

getCompression

public int getCompression()
Returns a code describing the compression being used to transfer a file. This will normally be COMPRESSION_NONE (to indicate that the transfer is not compressed).

Returns:
this header's compression code

getFileCount

public int getFileCount()
Returns the total number of files being transferred, or in the case of transferring a file list, the total number of files in the following file list.

Returns:
the total number of files being transferred or listed

getFilesLeft

public int getFilesLeft()
Returns the number of files (of the total number) that remain to be sent.

Returns:
the number of files that remain to be sent

getPartCount

public int getPartCount()
Returns the total number of file "parts" being sent. This will normally be 1 for most files and 2 for files on MacOS that have resource forks.

Returns:
the total number of file parts being sent

getPartsLeft

public int getPartsLeft()
Returns the number of "parts" (of the total number that remain to be sent.

Returns:
the number of file parts that remain to be sent

getTotalFileSize

public long getTotalFileSize()
Returns the total file size of all files being sent.

Returns:
the total size, in bytes, of all files being sent

getFileSize

public long getFileSize()
Returns the size of the file currently being sent.

Returns:
the size of the file currently being sent

getLastmod

public long getLastmod()
Returns the last modification date of the file being sent, in seconds since the unix epoch.

Returns:
the last modification date of the file being sent

getChecksum

public long getChecksum()
Returns a checksum of the file being transferred.

Returns:
a checksum of the file being transferred
See Also:
FileTransferChecksum

getResForkReceivedChecksum

public long getResForkReceivedChecksum()
Returns a checksum of the received MacOS resource fork data. Note that in most cases this value will be 0.

Returns:
a checksum of the received MacOS resource fork data
See Also:
FileTransferChecksum

getResForkSize

public long getResForkSize()
Returns the size of the MacOS resource fork of the file being transferred. Note that in most cases this will be 0.

Returns:
the size of the MacOS resource fork of the file being transferred

getCreated

public long getCreated()
Returns the creation date of the file being transferred, in seconds since the unix epoch. Note that WinAIM always sends 0 for this value.

Returns:
the creation date of the file being transferred

getResForkChecksum

public long getResForkChecksum()
Returns a checksum of the MacOS resource fork for the file being transferred.

Returns:
a checksum of the MacOS resource fork for the file being transferred

getBytesReceived

public long getBytesReceived()
Returns the number of bytes received for the file being transferred.

Returns:
the number of bytes received for the file being transferred

getReceivedChecksum

public long getReceivedChecksum()
Returns a checksum of the data received for the current file.

Returns:
a checksum of the data received for the currently transferring file

getClientid

public java.lang.String getClientid()
Returns the file transfer client ID string sent in this header. This will normally be a string describing the client, such as CLIENTID_DEFAULT or CLIENTID_OLD.

Returns:
the file transfer client ID string

getFlags

public int getFlags()
Returns the set of bit flags sent in this header. This will normally be a combination of the FLAG_* constants defined in this class.

Returns:
the set of bit flags sent in this header

getListNameOffset

public int getListNameOffset()
Returns the "list name offset" sent in this header. As of this writing, the significance of this value is unknown; it will normally be either 0 or LISTNAMEOFFSET_DEFAULT.

Returns:
the "list name offset" sent in this header

getListSizeOffset

public int getListSizeOffset()
Returns the "list size offset" sent in this header. As of this writing, the significance of this value is unknown; it will normally be either 0 or LISTSIZEOFFSET_DEFAULT.

Returns:
the "list size offset" sent in this header

getDummyBlock

public ByteBlock getDummyBlock()
Returns the value of the (sigh) 69-byte "dummy block" sent in this command. This block is normally full of null bytes (0x00).

Returns:
this header's "dummy block"

getMacFileInfo

public ByteBlock getMacFileInfo()
Returns the Mac file information block sent in this command. When receiving files from Windows or other non-Macintosh OS users, this value is normally MACFILEINFO_DEFAULT (a block of sixteen null bytes). When coming from a Macintosh user, however, this block is a copy of the file's FInfo block. For more information on reading and writing Macintosh file attributes in Java, see JConfig, an "extension of the core Java API's" for various platforms.

Returns:
the Mac file information block sent in this command

getFilename

public SegmentedFilename getFilename()
Returns an object representing the filename sent in this header.

Returns:
the filename sent in this header

getHeaderSize

public int getHeaderSize()
Returns the size, in bytes, of this header, or -1 if this header was not read from an incoming block of binary data.

Returns:
the size of this header, in bytes, or -1 if this header was not rea

setFtVersion

public void setFtVersion(java.lang.String ftVersion)
Sets the file transfer protocol version string for this header. This value should normally be FTVERSION_DEFAULT.

Parameters:
ftVersion - a new file transfer protocol version string

setHeaderType

public void setHeaderType(int headerType)
Sets this header's header type. This should normally be one of the HEADERTYPE_* constants defined in this class.

Parameters:
headerType - a new header type code

setIcbmMessageId

public void setIcbmMessageId(long icbmMessageId)
Sets this header's ICBM message ID. See getIcbmMessageId() for details on what this value means.

Parameters:
icbmMessageId - a new ICBM message ID

setEncryption

public void setEncryption(int encryption)
Sets this header's encryption mode to the given value. This value should normally be ENCRYPTION_NONE.

Parameters:
encryption - a new encryption method code

setCompression

public void setCompression(int compression)
Sets this header's encryption mode to the given value. This value should normally be COMPRESSION_NONE.

Parameters:
compression - a new compression method code

setFileCount

public void setFileCount(int fileCount)
Sets the total file count for this header. See getFileCount() for details on what this value means.

Parameters:
fileCount - a new total file count value for this header

setFilesLeft

public void setFilesLeft(int filesLeft)
Sets this header's "number of files remaining to be sent" value.

Parameters:
filesLeft - the number of files (of the total) remaining to be sent

setPartCount

public void setPartCount(int partCount)
Sets the total file part count for this header. See getPartCount() for details on what this value means.

Parameters:
partCount - a new total "file part" count for this header

setPartsLeft

public void setPartsLeft(int partsLeft)
Sets this header's "number of parts remaining to be sent" value.

Parameters:
partsLeft - the number of parts (of the total) remaining to be sent

setTotalFileSize

public void setTotalFileSize(long totalFileSize)
Sets the total cumulative size of all files being transferred.

Parameters:
totalFileSize - a new total file size value for this header

setFileSize

public void setFileSize(long fileSize)
Sets this header's value for the size of the file currently being transferred.

Parameters:
fileSize - the size of the file currently being transferred

setLastmod

public void setLastmod(long lastmod)
Sets the last modification date of the file being transferred, in seconds since the unix epoch, or 0 for none.

Parameters:
lastmod - the last modification date of the file being transferred

setChecksum

public void setChecksum(long checksum)
Sets the checksum of the file currently being transferred.

Parameters:
checksum - the checksum of the file currently being transferred

setResForkReceivedChecksum

public void setResForkReceivedChecksum(long resForkReceivedChecksum)
Sets the value of the checksum of the received portion of the MacOS "resource fork" being sent.

Parameters:
resForkReceivedChecksum - the checksum of the received portion of the MacOS resource fork being sent

setResForkSize

public void setResForkSize(long resForkSize)
Sets the size of the MacOS "resource fork" being sent.

Parameters:
resForkSize - the size, in bytes, of the MacOS resource fork being sent

setCreated

public void setCreated(long created)
Sets the creation date of the file being sent, or 0 for none. Note that WinAIM does not send the creation date of files being transferred.

Parameters:
created - the creation date of the file being sent, in seconds since the unix epoch

setResForkChecksum

public void setResForkChecksum(long resForkChecksum)
Sets the value of the checksum of the MacOS "resource fork" being transferred.

Parameters:
resForkChecksum - the value of the checksum of the MacOS resource fork being transferred

setBytesReceived

public void setBytesReceived(long bytesReceived)
Sets the number of bytes received in the current transfer.

Parameters:
bytesReceived - the number of bytes received in the current transfer

setReceivedChecksum

public void setReceivedChecksum(long receivedChecksum)
Sets the value of the checksum of the data received.

Parameters:
receivedChecksum - the checksum of the data received in the current transfer

setClientid

public void setClientid(java.lang.String clientid)
Sets the file transfer client ID string for this header. (WinAIM sends values like CLIENTID_DEFAULT and CLIENTID_OLD.) Note that the given string will be truncated to 32 characters as per the protocol spec.

Parameters:
clientid - the file transfer client ID string for this header

setFlags

public void setFlags(int flags)
Sets this header's bit flags. The given value should normally be a bitwise combination of the FLAG_* constants defined in this class.

Parameters:
flags - a set of bit flags for this header

setListNameOffset

public void setListNameOffset(int listNameOffset)
Sets the value of the "list name offset" in this header. As of this writing, the significance of this value is unknown. Recent versions of WinAIM always use LISTNAMEOFFSET_DEFAULT for this value.

Parameters:
listNameOffset - a new "list name offset" value

setListSizeOffset

public void setListSizeOffset(int listSizeOffset)
Sets the value of the "list size offset" in this header. As of this writing, the significance of this value is unknown. Recent versions of WinAIM always use LISTSIZEOFFSET_DEFAULT for this value.

Parameters:
listSizeOffset - a new "list size offset" value

setDummyBlock

public void setDummyBlock(ByteBlock dummyBlock)
Sets this header's "dummy block" value. Note that this value will be truncated to (sigh) 69 bytes as per the protocol spec. Note that in all clients this value is DUMMY_DEFAULT (69 null bytes).

Parameters:
dummyBlock - a new "dummy block" value

setMacFileInfo

public void setMacFileInfo(ByteBlock macFileInfo)
Sets this header's Mac file information block. See getMacFileInfo() for details on what this value means.

Parameters:
macFileInfo - a new Mac file information block value

setFilename

public void setFilename(SegmentedFilename filename)
Sets this header's filename value.

Parameters:
filename - the name of the file being transferred

setDefaults

public final void setDefaults()
Sets all fields in this header (except filename and headerType) to a set of default values. Calling this method is equivalent to executing the following code:
header.setClientid(FileTransferHeader.CLIENTID_DEFAULT);
header.setCompression(FileTransferHeader.COMPRESSION_NONE);
header.setEncryption(FileTransferHeader.ENCRYPTION_NONE);
header.setIcbmMessageId(0);
header.setDummyBlock(FileTransferHeader.DUMMY_DEFAULT);
header.setFlags(FileTransferHeader.FLAG_DEFAULT);
header.setFtVersion(FileTransferHeader.FTVERSION_DEFAULT);
header.setResForkChecksum(0);
header.setResForkReceivedChecksum(0);
header.setResForkSize(0);
header.setCreated(0);
header.setLastmod(0);
header.setChecksum(0);
header.setListNameOffset(0);
header.setListSizeOffset(0);
header.setMacFileInfo(FileTransferHeader.MACFILEINFO_DEFAULT);
header.setBytesReceived(0);
header.setFileCount(0);
header.setFileSize(0);
header.setFilesLeft(0);
header.setPartCount(0);
header.setPartsLeft(0);
header.setReceivedChecksum(0);
header.setTotalFileSize(0);
 


write

public void write(java.io.OutputStream out)
           throws java.io.IOException,
                  java.lang.IllegalArgumentException
Writes this header to the given stream. Note that all fields in this header must have valid values upon a call to this method; otherwise, an IllegalArgumentException will be thrown. A valid field has either a nonnegative (that is, 0 or greater) or non-null value. Only the filename field may be null; such a value indicates that no filename should be sent.

Specified by:
write in interface LiveWritable
Parameters:
out - the stream to which to write
Throws:
java.io.IOException - if an I/O error occurs
java.lang.IllegalArgumentException - if any field in this header has an invalid value

toString

public java.lang.String toString()