< prev index next >

src/java.desktop/share/classes/com/sun/media/sound/FastSysexMessage.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2002, 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) 2002, 2019, 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
*** 35,47 **** */ final class FastSysexMessage extends SysexMessage { FastSysexMessage(byte[] data) throws InvalidMidiDataException { super(data); ! if (data.length==0 || (((data[0] & 0xFF) != 0xF0) && ((data[0] & 0xFF) != 0xF7))) { ! super.setMessage(data, data.length); // will throw Exception ! } } /** * The returned array may be larger than this message is. * Use getLength() to get the real length of the message. --- 35,45 ---- */ final class FastSysexMessage extends SysexMessage { FastSysexMessage(byte[] data) throws InvalidMidiDataException { super(data); ! MidiUtils.checkSysexStatus(data, data.length); } /** * The returned array may be larger than this message is. * Use getLength() to get the real length of the message.
*** 52,64 **** // overwrite this method so that the original data array, // which is shared among all transmitters, cannot be modified @Override public void setMessage(byte[] data, int length) throws InvalidMidiDataException { ! if ((data.length == 0) || (((data[0] & 0xFF) != 0xF0) && ((data[0] & 0xFF) != 0xF7))) { ! super.setMessage(data, data.length); // will throw Exception ! } this.length = length; this.data = new byte[this.length]; System.arraycopy(data, 0, this.data, 0, length); } --- 50,60 ---- // overwrite this method so that the original data array, // which is shared among all transmitters, cannot be modified @Override public void setMessage(byte[] data, int length) throws InvalidMidiDataException { ! MidiUtils.checkSysexStatus(data, length); this.length = length; this.data = new byte[this.length]; System.arraycopy(data, 0, this.data, 0, length); }
< prev index next >