diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
commit | 556d92b63555a085b25e32b1cd55afce24edd07a (patch) | |
tree | 6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java | |
parent | a90f4a51dffec3247278e3c683ed4462b1dd9ab5 (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/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java index dcb1958df..0ac2dc6a0 100644 --- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java +++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java @@ -50,7 +50,7 @@ public class ChunkRaw { * @param alloc
* : it true, the data array will be allocced
*/
- public ChunkRaw(int len, byte[] idbytes, boolean alloc) {
+ public ChunkRaw(final int len, final byte[] idbytes, final boolean alloc) {
this.len = len;
System.arraycopy(idbytes, 0, this.idbytes, 0, 4);
if (alloc)
@@ -66,7 +66,7 @@ public class ChunkRaw { * this is called after setting data, before writing to os
*/
private int computeCrc() {
- CRC32 crcengine = PngHelperInternal.getCRC();
+ final CRC32 crcengine = PngHelperInternal.getCRC();
crcengine.reset();
crcengine.update(idbytes, 0, 4);
if (len > 0)
@@ -78,7 +78,7 @@ public class ChunkRaw { * Computes the CRC and writes to the stream. If error, a
* PngjOutputException is thrown
*/
- public void writeChunk(OutputStream os) {
+ public void writeChunk(final OutputStream os) {
if (idbytes.length != 4)
throw new PngjOutputException("bad chunkid [" + ChunkHelper.toString(idbytes) + "]");
crcval = computeCrc();
@@ -93,11 +93,11 @@ public class ChunkRaw { * position before: just after chunk id. positon after: after crc Data
* should be already allocated. Checks CRC Return number of byte read.
*/
- public int readChunkData(InputStream is, boolean checkCrc) {
+ public int readChunkData(final InputStream is, final boolean checkCrc) {
PngHelperInternal.readBytes(is, data, 0, len);
crcval = PngHelperInternal.readInt4(is);
if (checkCrc) {
- int crc = computeCrc();
+ final int crc = computeCrc();
if (crc != crcval)
throw new PngjBadCrcException("chunk: " + this + " crc calc=" + crc + " read=" + crcval);
}
|