--- old/src/java.base/share/classes/sun/nio/fs/Util.java 2018-02-13 17:25:19.000000000 -0800 +++ new/src/java.base/share/classes/sun/nio/fs/Util.java 2018-02-13 17:25:19.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -25,9 +25,10 @@ package sun.nio.fs; -import java.util.*; -import java.nio.file.*; import java.nio.charset.Charset; +import java.nio.file.LinkOption; +import java.util.HashSet; +import java.util.Set; import sun.security.action.GetPropertyAction; /** @@ -48,22 +49,29 @@ } /** - * Encodes the given String into a sequence of bytes using the {@code Charset} - * specified by the sun.jnu.encoding property. + * Encodes the given String into a sequence of bytes using the + * {@code Charset} specified by the sun.jnu.encoding property. */ static byte[] toBytes(String s) { return s.getBytes(jnuEncoding); } /** - * Constructs a new String by decoding the specified array of bytes using the - * {@code Charset} specified by the sun.jnu.encoding property. + * Constructs a new String by decoding the specified array of bytes + * using the {@code Charset} specified by the sun.jnu.encoding property. + */ + static String toString(byte[] bytes, int offset, int length) { + return new String(bytes, offset, length, jnuEncoding); + } + + /** + * Constructs a new String by decoding the specified sub-array of bytes + * using the {@code Charset} specified by the sun.jnu.encoding property. */ static String toString(byte[] bytes) { return new String(bytes, jnuEncoding); } - /** * Splits a string around the given character. The array returned by this * method contains each substring that is terminated by the character. Use