< prev index next >

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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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

@@ -45,11 +45,11 @@
     /* Tables used for A-law decoding */
 
     private static final byte[] ALAW_TABH = new byte[256];
     private static final byte[] ALAW_TABL = new byte[256];
 
-    private static final short seg_end[] = {
+    private static final short[] seg_end = {
             0xFF, 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF
     };
 
     /**
      * Initializes the decode tables.

@@ -89,22 +89,22 @@
 
         if( sourceFormat.getEncoding().equals( AudioFormat.Encoding.PCM_SIGNED )) {
 
             if( sourceFormat.getSampleSizeInBits() == 16 ) {
 
-                AudioFormat.Encoding enc[] = new AudioFormat.Encoding[1];
+                AudioFormat.Encoding[] enc = new AudioFormat.Encoding[1];
                 enc[0] = AudioFormat.Encoding.ALAW;
                 return enc;
 
             } else {
                 return new AudioFormat.Encoding[0];
             }
         } else if( sourceFormat.getEncoding().equals( AudioFormat.Encoding.ALAW ) ) {
 
             if( sourceFormat.getSampleSizeInBits() == 8 ) {
 
-                AudioFormat.Encoding enc[] = new AudioFormat.Encoding[1];
+                AudioFormat.Encoding[] enc = new AudioFormat.Encoding[1];
                 enc[0] = AudioFormat.Encoding.PCM_SIGNED;
                 return enc;
 
             } else {
                 return new AudioFormat.Encoding[0];

@@ -244,22 +244,22 @@
 
     private final class AlawCodecStream extends AudioInputStream {
 
         // tempBuffer required only for encoding (when encode is true)
         private static final int tempBufferSize = 64;
-        private byte tempBuffer [] = null;
+        private byte[] tempBuffer  = null;
 
         /**
          * True to encode to a-law, false to decode to linear
          */
         boolean encode = false;
 
         AudioFormat encodeFormat;
         AudioFormat decodeFormat;
 
-        byte tabByte1[] = null;
-        byte tabByte2[] = null;
+        byte[] tabByte1 = null;
+        byte[] tabByte2 = null;
         int highByte = 0;
         int lowByte  = 1;
 
         AlawCodecStream(AudioInputStream stream, AudioFormat outputFormat) {
 

@@ -318,11 +318,11 @@
 
         /*
          * $$jb 2/23/99
          * Used to determine segment number in aLaw encoding
          */
-        private short search(short val, short table[], short size) {
+        private short search(short val, short[] table, short size) {
             for(short i = 0; i < size; i++) {
                 if (val <= table[i]) { return i; }
             }
             return size;
         }
< prev index next >