Examples: getItemValueCustomDataBytes method

This agent gets custom data in the current document. The custom data is in an item named TenBytesItem and was given a type name of TenBytesType when it was written.

import lotus.domino.*;
import java.io.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      Document doc = agentContext.getDocumentContext();
      if (doc.hasItem("TenBytesItem")) {
        byte[] bytes = doc.getItemValueCustomDataBytes(
        "TenBytesItem", "TenBytesType");
          for (int i = 0; i < 10; i++)
            System.out.println( (char) bytes[i] );
      }
      else
      {
        System.out.println("No item TenBytesItem in document");
      }

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}