< prev index next >

src/java.base/share/classes/sun/nio/fs/Util.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2009, 2013, 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) 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 23,35 **** * questions. */ package sun.nio.fs; - import java.util.*; - import java.nio.file.*; import java.nio.charset.Charset; import sun.security.action.GetPropertyAction; /** * Utility methods */ --- 23,36 ---- * questions. */ package sun.nio.fs; import java.nio.charset.Charset; + import java.nio.file.LinkOption; + import java.util.HashSet; + import java.util.Set; import sun.security.action.GetPropertyAction; /** * Utility methods */
*** 46,71 **** static Charset jnuEncoding() { return jnuEncoding; } /** ! * 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. */ 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 * for simple string spilting cases when needing to avoid loading regex. */ --- 47,79 ---- static Charset jnuEncoding() { return jnuEncoding; } /** ! * 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. ! */ ! 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 * for simple string spilting cases when needing to avoid loading regex. */
< prev index next >