mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
Address Codacy error and and netbeans suggestion in BinaryCookieReader.java, array now copied
This commit is contained in:
parent
dfeeb60367
commit
19e3be1f39
@ -42,6 +42,7 @@ import org.sleuthkit.autopsy.recentactivity.BinaryCookieReader.Cookie;
|
||||
*/
|
||||
final class BinaryCookieReader implements Iterable<Cookie> {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(BinaryCookieReader.class.getName());
|
||||
private static final int MAGIC_SIZE = 4;
|
||||
private static final int SIZEOF_INT_BYTES = 4;
|
||||
private static final int PAGE_HEADER_VALUE = 256;
|
||||
@ -53,8 +54,6 @@ final class BinaryCookieReader implements Iterable<Cookie> {
|
||||
private final int[] pageSizeArray;
|
||||
private final File cookieFile;
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(BinaryCookieReader.class.getName());
|
||||
|
||||
/**
|
||||
* The binary cookie reader encapsulates all the knowledge of how to read
|
||||
* the mac .binarycookie files into one class.
|
||||
@ -62,7 +61,7 @@ final class BinaryCookieReader implements Iterable<Cookie> {
|
||||
*/
|
||||
private BinaryCookieReader(File cookieFile, int[] pageSizeArray) {
|
||||
this.cookieFile = cookieFile;
|
||||
this.pageSizeArray = pageSizeArray;
|
||||
this.pageSizeArray = pageSizeArray.clone();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,7 +70,9 @@ final class BinaryCookieReader implements Iterable<Cookie> {
|
||||
* open.
|
||||
*
|
||||
* @param cookieFile binarycookie file
|
||||
*
|
||||
* @return An instance of the reader
|
||||
*
|
||||
* @throws FileNotFoundException
|
||||
* @throws IOException
|
||||
*/
|
||||
@ -229,6 +230,7 @@ final class BinaryCookieReader implements Iterable<Cookie> {
|
||||
* correct format by checking for the header value of 0x0100.
|
||||
*
|
||||
* @param page byte array representing a cookie page
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
CookiePage(byte[] page) throws IOException {
|
||||
@ -414,7 +416,8 @@ final class BinaryCookieReader implements Iterable<Cookie> {
|
||||
* offset ending at the first null terminator found.
|
||||
*
|
||||
* @param byteArray Array of bytes
|
||||
* @param offset starting offset in the array
|
||||
* @param offset starting offset in the array
|
||||
*
|
||||
* @return String with bytes converted to ascii
|
||||
*/
|
||||
private String decodeString(byte[] byteArray, int offset) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user