src/share/classes/javax/imageio/plugins/jpeg/JPEGImageReadParam.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2000, 2001, 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) 2000, 2014, 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
*** 130,142 ****
(ACHuffmanTables.length > 4) ||
(DCHuffmanTables.length != ACHuffmanTables.length)) {
throw new IllegalArgumentException
("Invalid JPEG table arrays");
}
! this.qTables = (JPEGQTable[])qTables.clone();
! this.DCHuffmanTables = (JPEGHuffmanTable[])DCHuffmanTables.clone();
! this.ACHuffmanTables = (JPEGHuffmanTable[])ACHuffmanTables.clone();
}
/**
* Removes any quantization and Huffman tables that are currently
* set.
--- 130,142 ----
(ACHuffmanTables.length > 4) ||
(DCHuffmanTables.length != ACHuffmanTables.length)) {
throw new IllegalArgumentException
("Invalid JPEG table arrays");
}
! this.qTables = qTables.clone();
! this.DCHuffmanTables = DCHuffmanTables.clone();
! this.ACHuffmanTables = ACHuffmanTables.clone();
}
/**
* Removes any quantization and Huffman tables that are currently
* set.
*** 158,168 ****
* <code>null</code>.
*
* @see #setDecodeTables
*/
public JPEGQTable[] getQTables() {
! return (qTables != null) ? (JPEGQTable[])qTables.clone() : null;
}
/**
* Returns a copy of the array of DC Huffman tables set on the
* most recent call to <code>setDecodeTables</code>, or
--- 158,168 ----
* <code>null</code>.
*
* @see #setDecodeTables
*/
public JPEGQTable[] getQTables() {
! return (qTables != null) ? qTables.clone() : null;
}
/**
* Returns a copy of the array of DC Huffman tables set on the
* most recent call to <code>setDecodeTables</code>, or
*** 173,183 ****
*
* @see #setDecodeTables
*/
public JPEGHuffmanTable[] getDCHuffmanTables() {
return (DCHuffmanTables != null)
! ? (JPEGHuffmanTable[])DCHuffmanTables.clone()
: null;
}
/**
* Returns a copy of the array of AC Huffman tables set on the
--- 173,183 ----
*
* @see #setDecodeTables
*/
public JPEGHuffmanTable[] getDCHuffmanTables() {
return (DCHuffmanTables != null)
! ? DCHuffmanTables.clone()
: null;
}
/**
* Returns a copy of the array of AC Huffman tables set on the
*** 189,197 ****
*
* @see #setDecodeTables
*/
public JPEGHuffmanTable[] getACHuffmanTables() {
return (ACHuffmanTables != null)
! ? (JPEGHuffmanTable[])ACHuffmanTables.clone()
: null;
}
}
--- 189,197 ----
*
* @see #setDecodeTables
*/
public JPEGHuffmanTable[] getACHuffmanTables() {
return (ACHuffmanTables != null)
! ? ACHuffmanTables.clone()
: null;
}
}