Skip to content

message.getDICOMPreamble

Use when: You want to read values from the modified message during mapping. If you need the original incoming message, use source.getDICOMPreamble.

Signature: message.getDICOMPreamble()

Returns: byte[] preambleBytes - the preamble bytes or null if none exist

Get the DICOM preamble.

Parameters

None

Example

// assumes `message` is a DICOM message model object

// Retrieve the DICOM preamble bytes (if present)
var dicomPreamble = message.getDICOMPreamble();

// Result:
// - If a preamble exists:
//     dicomPreamble contains a byte[] with the 128-byte DICOM preamble
// - If no preamble exists:
//     dicomPreamble is null