diff -r 8c0b6bccfe47 -r 0989ad8c0860 src/share/jaxws_classes/com/sun/xml/internal/ws/util/ReadAllStream.java --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ReadAllStream.java Thu Apr 04 19:05:24 2013 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/util/ReadAllStream.java Tue Apr 09 14:51:13 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,8 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Reads a input stream completely and creates a new stream @@ -48,6 +50,8 @@ private boolean readAll; private boolean closed; + private static final Logger LOGGER = Logger.getLogger(ReadAllStream.class.getName()); + public ReadAllStream() { memStream = new MemoryStream(); fileStream = new FileStream(); @@ -75,6 +79,7 @@ } } + @Override public int read() throws IOException { int ch = memStream.read(); if (ch == -1) { @@ -92,6 +97,7 @@ return len; } + @Override public void close() throws IOException { if (!closed) { memStream.close(); @@ -120,6 +126,7 @@ fin = new FileInputStream(tempFile); } + @Override public int read() throws IOException { return (fin != null) ? fin.read() : -1; } @@ -135,7 +142,10 @@ fin.close(); } if (tempFile != null) { - tempFile.delete(); + boolean success = tempFile.delete(); + if (!success) { + LOGGER.log(Level.INFO, "File {0} could not be deleted", tempFile); + } } } } @@ -168,12 +178,15 @@ byte[] buf = new byte[8192]; int read = fill(in, buf); total += read; - if (read != 0) + if (read != 0) { add(buf, read); - if (read != buf.length) - return true; // EOF - if (total > inMemory) - return false; // Reached in-memory size + } + if (read != buf.length) { + return true; + } // EOF + if (total > inMemory) { + return false; // Reached in-memory size + } } } @@ -186,6 +199,7 @@ return total; } + @Override public int read() throws IOException { if (!fetch()) { return -1;