File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
marklogic-client-api/src/main/java/com/marklogic/client Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,10 @@ public void fromBuffer(byte[] buffer) {
6767 receiveContent (new ByteArrayInputStream (buffer ));
6868 }
6969 public byte [] toBuffer () {
70- return contentToBytes (get ());
70+ byte [] b = contentToBytes (get ());
71+ if (!isResendable ())
72+ fromBuffer (b );
73+ return b ;
7174 }
7275 public T bytesToContent (byte [] buffer ) {
7376 return toContent (new ByteArrayInputStream (buffer ));
Original file line number Diff line number Diff line change @@ -183,8 +183,12 @@ protected OutputStreamSender sendContent() {
183183 }
184184 @ Override
185185 protected OutputStreamSender sendContent (JsonParser parser ) {
186- if (parser == null ) return null ;
187- return new OutputStreamSenderImpl (getMapper (), parser );
186+ try {
187+ if (parser == null || parser .nextToken () == null ) return null ;
188+ return new OutputStreamSenderImpl (getMapper (), parser );
189+ } catch (IOException e ) {
190+ throw new MarkLogicIOException ("Failed to parse content" , e );
191+ }
188192 }
189193
190194 @ Override
You can’t perform that action at this time.
0 commit comments