< prev index next >

src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1996, 2013, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1996, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 54,68 **** if (size() < 4) { // 4: handshake message header size // internal_error alert will be triggered throw new RuntimeException("handshake message is not available"); } ! // outputRecord cannot be null outputRecord.encodeHandshake(buf, 0, count); // reset the byte array output stream reset(); } // // overridden ByteArrayOutputStream methods // --- 54,69 ---- if (size() < 4) { // 4: handshake message header size // internal_error alert will be triggered throw new RuntimeException("handshake message is not available"); } ! if (outputRecord != null) { outputRecord.encodeHandshake(buf, 0, count); // reset the byte array output stream reset(); + } // otherwise, the handshake outstream is temporarily used only. } // // overridden ByteArrayOutputStream methods //
*** 74,85 **** --- 75,88 ---- super.write(b, off, len); } @Override public void flush() throws IOException { + if (outputRecord != null) { outputRecord.flush(); } + } // // handshake output stream management functions //
*** 104,113 **** --- 107,123 ---- super.write(i >> 16); super.write(i >> 8); super.write(i); } + void putInt32(int i) throws IOException { + super.write(i >> 24); + super.write(i >> 16); + super.write(i >> 8); + super.write(i); + } + /* * Put byte arrays with length encoded as 8, 16, 24 bit * integers in big-endian format. */ void putBytes8(byte[] b) throws IOException {
< prev index next >