# Class PstAttachmentWriter

java.lang.Object
com.independentsoft.pst.PstAttachmentWriter

public class PstAttachmentWriter extends Object
Represents a file attachment to be created on a message in a new PST file (write side). Note: attachment data must currently fit within a single block (~7 KB); larger attachments (requiring XBLOCK data trees) are not yet supported.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PstAttachmentWriter(String fileName, byte[] data)`
  Initializes a new instance of the `PstAttachmentWriter` class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `getData()`
  Gets the attachment content.
  `String`
  `getFileName()`
  Gets the file name.
  `void`
  `setData(byte[] data)`
  Sets the attachment content.
  `void`
  `setFileName(String fileName)`
  Sets the file name.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PstAttachmentWriter

    public PstAttachmentWriter(String fileName, byte[] data)
    Initializes a new instance of the `PstAttachmentWriter` class.
    Parameters:
      `fileName` - the attachment file name.
      `data` - the attachment content.

- ## Method Details

  - ### getFileName

    public String getFileName()
    Gets the file name.
    Returns:
      the file name.

  - ### setFileName

    public void setFileName(String fileName)
    Sets the file name.
    Parameters:
      `fileName` - the file name.

  - ### getData

    public byte[] getData()
    Gets the attachment content.
    Returns:
      the attachment content.

  - ### setData

    public void setData(byte[] data)
    Sets the attachment content.
    Parameters:
      `data` - the attachment content.