Skip to content

Commit a4bcfe8

Browse files
committed
One warning less
1 parent 5017aa2 commit a4bcfe8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

as2-lib/src/main/java/com/helger/as2lib/util/http/AS2HttpClient.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,15 @@ public boolean isStreaming ()
219219
public void writeTo (@Nonnull final OutputStream aOS) throws IOException
220220
{
221221
// Use MIME encoding here
222-
try (final OutputStream aDebugOS = aOutgoingDumper != null ? aOutgoingDumper.getDumpOS (aOS) : aOS;
223-
final OutputStream aEncodedOS = eCTE != null ? AS2IOHelper.getContentTransferEncodingAwareOutputStream (aDebugOS,
224-
eCTE.getID ())
225-
: aDebugOS)
222+
try (final OutputStream aDebugOS = aOutgoingDumper != null ? aOutgoingDumper.getDumpOS (aOS) : aOS)
226223
{
227-
StreamHelper.copyByteStream ().from (aCIS).closeFrom (true).to (aEncodedOS).closeTo (false).build ();
224+
try (
225+
final OutputStream aEncodedOS = eCTE != null ? AS2IOHelper.getContentTransferEncodingAwareOutputStream (aDebugOS,
226+
eCTE.getID ())
227+
: aDebugOS)
228+
{
229+
StreamHelper.copyByteStream ().from (aCIS).closeFrom (true).to (aEncodedOS).closeTo (false).build ();
230+
}
228231
}
229232
catch (final MessagingException ex)
230233
{

0 commit comments

Comments
 (0)