aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/openal/util/WAVData.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:27:25 +0200
committerSven Gothel <[email protected]>2014-07-03 16:27:25 +0200
commit0430708fbcbdc5572affb45318eb782adffd13f1 (patch)
tree61ac401ea90e07ae0a7ac639da1e6a240f1b87cd /src/java/com/jogamp/openal/util/WAVData.java
parent21cd5206625aaa8914e53bdfaab8e7ae4e497a08 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/com/jogamp/openal/util/WAVData.java')
-rw-r--r--src/java/com/jogamp/openal/util/WAVData.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/java/com/jogamp/openal/util/WAVData.java b/src/java/com/jogamp/openal/util/WAVData.java
index 9fab8ba..94dd002 100644
--- a/src/java/com/jogamp/openal/util/WAVData.java
+++ b/src/java/com/jogamp/openal/util/WAVData.java
@@ -74,7 +74,7 @@ public final class WAVData {
/** flag indicating whether or not the sound in the data should loop */
public final boolean loop;
- public WAVData(ByteBuffer data, int format, int size, int freq, boolean loop) {
+ public WAVData(final ByteBuffer data, final int format, final int size, final int freq, final boolean loop) {
this.data = data;
this.format = format;
this.size = size;
@@ -98,7 +98,7 @@ public final class WAVData {
* @throws IOException If the file can no be found or some other IO error
* occurs
*/
- public static WAVData loadFromStream(InputStream aIn, int initialCapacity, int numChannels, int bits, int sampleRate, ByteOrder byteOrder, boolean loop)
+ public static WAVData loadFromStream(InputStream aIn, final int initialCapacity, final int numChannels, final int bits, final int sampleRate, final ByteOrder byteOrder, final boolean loop)
throws IOException {
if( !(aIn instanceof BufferedInputStream) ) {
aIn = new BufferedInputStream(aIn);
@@ -115,21 +115,21 @@ public final class WAVData {
} else if ((bits == 16) && (numChannels == 2)) {
format = ALConstants.AL_FORMAT_STEREO16;
}
- ByteBuffer buffer = IOUtil.copyStream2ByteBuffer(aIn, initialCapacity);
- int size = buffer.limit();
+ final ByteBuffer buffer = IOUtil.copyStream2ByteBuffer(aIn, initialCapacity);
+ final int size = buffer.limit();
// Must byte swap in case endianess mismatch
if ( bits == 16 && ByteOrder.nativeOrder() != byteOrder ) {
- int len = buffer.remaining();
+ final int len = buffer.remaining();
for (int i = 0; i < len; i += 2) {
- byte a = buffer.get(i);
- byte b = buffer.get(i+1);
+ final byte a = buffer.get(i);
+ final byte b = buffer.get(i+1);
buffer.put(i, b);
buffer.put(i+1, a);
}
}
- WAVData result = new WAVData(buffer, format, size, sampleRate, loop);
+ final WAVData result = new WAVData(buffer, format, size, sampleRate, loop);
aIn.close();
return result;