---
Product: psd
Platform: java
Page Type: docs
Canonical URL: https://docs.aspose.org/psd/java/developer-guide/write-descriptors
---

# Write Descriptors

The writer classes of Aspose.PSD FOSS for Java: PsdImageWriter and the loader and writer classes behind PsdImage.save, and why you normally call PsdImage.save instead.

## Overview

The package `org.aspose.psd.writedescriptors` has one public class, `PsdImageWriter`. Its `save` method writes a `PsdImageDocumentState` to an `OutputStream`. It is the low-level writer that sits behind `PsdImage.save`, together with `PsdImageLoader` (package `org.aspose.psd.loaders`), which reads a document from a stream into a document state.

---

### Use PsdImage.save

`PsdImage.save(String)` and `PsdImage.save(OutputStream)` are the supported way to write a document. In the library's own tests a document that is saved without changes is written back identically, and a document with changed layer metadata contains the changes when it is loaded again. `PsdImage.save(OutputStream)` closes the stream that you pass in. See [Core API](../core-api/) and [Layers](../layers/).

---

### The Writer and Loader Classes

| Class | Package | Role |
|---|---|---|
| `PsdImageWriter` | `org.aspose.psd.writedescriptors` | Writes a `PsdImageDocumentState` to an `OutputStream` |
| `PsdImageLoader` | `org.aspose.psd.loaders` | Loads a `PsdImageDocumentState` from an `InputStream` |
| `LayerAndMaskSectionWriter`, `LayerAndMaskSectionReader` | `org.aspose.psd` | Write and read the layer and mask information section |
| `LayerRecordWriter`, `LayerRecordReader` | `org.aspose.psd.layers` | Write and read the layer records |
| `BigEndianWriter`, `BigEndianReader` | `org.aspose.psd` | Write and read big-endian binary data |

---

### Tips and Best Practices

- Call `PsdImage.save` unless you are building your own tool on the document state.
- Do not rely on the writer classes for anything beyond what `PsdImage.save` does.

---

### Common Issues

| Issue | Cause | Fix |
|---|---|---|
| You want to write a document without a `PsdImage` | `PsdImageWriter.save` needs a `PsdImageDocumentState` | Load the file with `PsdImage` and save it with `PsdImage.save` |

---

### FAQ

#### Is `PsdImageWriter` the way to save a PSD?

No. Use `PsdImage.save`.

---

### API Reference Summary

| Class | Description |
|---|---|
| [PsdImageWriter](https://reference.aspose.org/psd/java/psdimagewriter/) | Writes a document state to a stream |
| [PsdImageLoader](https://reference.aspose.org/psd/java/psdimageloader/) | Loads a document state from a stream |
| [PsdImageDocumentState](https://reference.aspose.org/psd/java/psdimagedocumentstate/) | The parsed sections of a document |

## See Also

- [Aspose.PSD — Enterprise Documentation](https://docs.aspose.com/psd/)