HPInc / jipp

A Java-compatible implementation of IPP
MIT License
151 stars 42 forks source link

Allow IppOutputstream to be used for serializing single attributes and groups #102

Closed Peter-printix closed 3 years ago

Peter-printix commented 3 years ago

Registering virtual printers in Microsoft universal Print, requires you to send an ipp payload consisting only of an attribute group (see: Print https://docs.microsoft.com/en-us/graph/api/printer-update?view=graph-rest-beta&tabs=http ). There doesn't currently appear to be a way to generate such a payload using jipp (let me know if I'm wrong). This pull request simply makes public the relevant functions on the IppOutputStream. I included the "write(attribute: Attribute<*>, name: String = attribute.name)" function, purely for consistency, it's not technically required.

GladeDiviney commented 3 years ago

This is good. Is there a need to write single attributes as well? I see you mentioned that; let's leave it private for now since things can go sideways easily when writing individual attributes.

(I'm taking care of single-group reads as well)

GladeDiviney commented 3 years ago

Will fix #103

Peter-printix commented 3 years ago

I'm not sure about the need to write single attributes. It's not needed for our specific use case (Universal Print), so if you prefer to keep that one private that would be perfectly fine.