< prev index next >
src/java.desktop/share/classes/com/sun/imageio/plugins/tiff/TIFFLZWDecompressor.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2005, 2016, 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) 2005, 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
*** 32,42 ****
private static final int CLEAR_CODE = 256;
private static final int EOI_CODE = 257;
private static final int FIRST_CODE = 258;
! private static final int andTable[] = {
511,
1023,
2047,
4095
};
--- 32,42 ----
private static final int CLEAR_CODE = 256;
private static final int EOI_CODE = 257;
private static final int FIRST_CODE = 258;
! private static final int[] andTable = {
511,
1023,
2047,
4095
};
*** 51,61 ****
private byte[] dstData;
private int srcIndex;
private int dstIndex;
! private byte stringTable[][];
private int tableIndex, bitsToGet = 9;
private int nextData = 0;
private int nextBits = 0;
--- 51,61 ----
private byte[] dstData;
private int srcIndex;
private int dstIndex;
! private byte[][] stringTable;
private int tableIndex, bitsToGet = 9;
private int nextData = 0;
private int nextBits = 0;
*** 213,223 ****
}
/**
* Write out the string just uncompressed.
*/
! public void writeString(byte string[]) {
if(dstIndex < dstData.length) {
int maxIndex = Math.min(string.length,
dstData.length - dstIndex);
for (int i=0; i < maxIndex; i++) {
--- 213,223 ----
}
/**
* Write out the string just uncompressed.
*/
! public void writeString(byte[] string) {
if(dstIndex < dstData.length) {
int maxIndex = Math.min(string.length,
dstData.length - dstIndex);
for (int i=0; i < maxIndex; i++) {
*** 227,239 ****
}
/**
* Add a new string to the string table.
*/
! public void addStringToTable(byte oldString[], byte newString) {
int length = oldString.length;
! byte string[] = new byte[length + 1];
System.arraycopy(oldString, 0, string, 0, length);
string[length] = newString;
// Add this new String to the table
stringTable[tableIndex++] = string;
--- 227,239 ----
}
/**
* Add a new string to the string table.
*/
! public void addStringToTable(byte[] oldString, byte newString) {
int length = oldString.length;
! byte[] string = new byte[length + 1];
System.arraycopy(oldString, 0, string, 0, length);
string[length] = newString;
// Add this new String to the table
stringTable[tableIndex++] = string;
*** 248,258 ****
}
/**
* Add a new string to the string table.
*/
! public void addStringToTable(byte string[]) {
// Add this new String to the table
stringTable[tableIndex++] = string;
if (tableIndex == 511) {
bitsToGet = 10;
--- 248,258 ----
}
/**
* Add a new string to the string table.
*/
! public void addStringToTable(byte[] string) {
// Add this new String to the table
stringTable[tableIndex++] = string;
if (tableIndex == 511) {
bitsToGet = 10;
*** 264,276 ****
}
/**
* Append {@code newString} to the end of {@code oldString}.
*/
! public byte[] composeString(byte oldString[], byte newString) {
int length = oldString.length;
! byte string[] = new byte[length + 1];
System.arraycopy(oldString, 0, string, 0, length);
string[length] = newString;
return string;
}
--- 264,276 ----
}
/**
* Append {@code newString} to the end of {@code oldString}.
*/
! public byte[] composeString(byte[] oldString, byte newString) {
int length = oldString.length;
! byte[] string = new byte[length + 1];
System.arraycopy(oldString, 0, string, 0, length);
string[length] = newString;
return string;
}
< prev index next >