Classes inheriting WireOutput concern themselves with sending data back to the client using PG
wire protocol. These classes function similarly to com.google.cloud.spanner.pgadapter.wireprotocol.WireMessage in that they use the constructor to
instantiate items, but require send to be called to actually send data. Here, you must override
postSend with data you wish to send. Note that this subclass will handle sending the identifier
and length (provided you initialize them correctly through getIdentifier and he constructor
respectively) via send, so you just have to implement payload sending.
Whether this response sends more data than just the identifier (i.e.: length). WireOutput items
are convoluted in that some do send a large payload, and other (such as DeclineSSLResponse) send only one byte back. Override with false if that is the case.
This is the method which must be called to actually send data. Here we log information, send
the protocol identifier and length automatically (provided those items were instantiated
correctly). For most WireOutput subclasses this should be unchanged; there are however
exceptions (such as where length) need not be sent for very specific protocols: for those,
override this and you will need to send the identifier and log yourself.
Same as #send(), but with the option to skip the flush at the end. This is more
efficient for responses that contain multiple parts, such as query results.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class WireOutput (0.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.27.1 (latest)](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.27.0](/java/docs/reference/pgadapter/0.27.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.26.0](/java/docs/reference/pgadapter/0.26.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.25.0](/java/docs/reference/pgadapter/0.25.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.24.0](/java/docs/reference/pgadapter/0.24.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.23.1](/java/docs/reference/pgadapter/0.23.1/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.22.1](/java/docs/reference/pgadapter/0.22.1/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.21.0](/java/docs/reference/pgadapter/0.21.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.20.0](/java/docs/reference/pgadapter/0.20.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.19.1](/java/docs/reference/pgadapter/0.19.1/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.18.4](/java/docs/reference/pgadapter/0.18.4/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.17.0](/java/docs/reference/pgadapter/0.17.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.16.0](/java/docs/reference/pgadapter/0.16.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.15.0](/java/docs/reference/pgadapter/0.15.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.14.1](/java/docs/reference/pgadapter/0.14.1/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.9.0](/java/docs/reference/pgadapter/0.9.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.8.0](/java/docs/reference/pgadapter/0.8.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.7.0](/java/docs/reference/pgadapter/0.7.0/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.6.1](/java/docs/reference/pgadapter/0.6.1/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput)\n- [0.5.1](/java/docs/reference/pgadapter/0.5.1/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput) \n\n public abstract class WireOutput\n\nClasses inheriting WireOutput concern themselves with sending data back to the client using PG\nwire protocol. These classes function similarly to [com.google.cloud.spanner.pgadapter.wireprotocol.WireMessage](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireprotocol.WireMessage) in that they use the constructor to\ninstantiate items, but require send to be called to actually send data. Here, you must override\npostSend with data you wish to send. Note that this subclass will handle sending the identifier\nand length (provided you initialize them correctly through getIdentifier and he constructor\nrespectively) via send, so you just have to implement payload sending. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e WireOutput \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Fields\n-------------\n\n### UTF8\n\n protected static final Charset UTF8\n\nConstructors\n------------\n\n### WireOutput(DataOutputStream output, int length)\n\n public WireOutput(DataOutputStream output, int length)\n\nFields\n------\n\n### length\n\n protected int length\n\n### outputStream\n\n protected DataOutputStream outputStream\n\nMethods\n-------\n\n### getIdentifier()\n\n public abstract byte getIdentifier()\n\nOverride this to specify the byte which represents the protocol for the specific message. Used\nfor logging and by send.\n\n### getMessageName()\n\n protected abstract String getMessageName()\n\nUsed for logging.\n\n### getPayloadString()\n\n protected abstract String getPayloadString()\n\nUsed for logging.\n\n### isCompoundResponse()\n\n protected boolean isCompoundResponse()\n\nWhether this response sends more data than just the identifier (i.e.: length). WireOutput items\nare convoluted in that some do send a large payload, and other (such as [DeclineSSLResponse](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireoutput.DeclineSSLResponse)) send only one byte back. Override with false if that is the case.\n\n### send()\n\n public void send()\n\nThis is the method which must be called to actually send data. Here we log information, send\nthe protocol identifier and length automatically (provided those items were instantiated\ncorrectly). For most WireOutput subclasses this should be unchanged; there are however\nexceptions (such as where length) need not be sent for very specific protocols: for those,\noverride this and you will need to send the identifier and log yourself.\n\n### send(boolean flush)\n\n public void send(boolean flush)\n\nSame as [#send()](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.wireoutput.WireOutput#com_google_cloud_spanner_pgadapter_wireoutput_WireOutput_send__), but with the option to skip the flush at the end. This is more\nefficient for responses that contain multiple parts, such as query results.\n\n### sendPayload()\n\n protected abstract void sendPayload()\n\nOverride this method to include post-processing and metadata in the sending process. Template\nmethod for send.\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]