By default, the virtual machine grows or shrinks the heap at each collection to try to keep the proportion of free space to live objects at each collection within a specific range. This target range is set as a percentage by the parameters -XX:MinHeapFreeRatio= and -XX:MaxHeapFreeRatio=, and the total size is bounded below by -Xms and above by -Xmx .
Creating BufferedReader from Files.newBufferedReader
Files.newBufferedReader(Paths.get("a.txt"), StandardCharsets.UTF_8);
when running the application it may throw the following exception:
java.nio.charset.MalformedInputException: Input length = 1
But
new BufferedReader(new InputStreamReader(new FileInputStream("a.txt"),"utf-8"));
works well.
The different is that, the former uses CharsetDecoder default action.
The default action for malformed-input and unmappable-character errors is to report them.
while the latter uses the REPLACE action.
cs.newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE)
There are two ways to specify how GET parameters are interpreted:
Set the URIEncoding attribute on the <Connector> element in server.xml to something specific (e.g. URIEncoding="UTF-8").
Set the useBodyEncodingForURI attribute on the <Connector> element in server.xml to true. This will cause the Connector to use the request body's encoding for GET parameters.
K. Tokuda, T. Yoshimura, T. Masuko, T. Kobayashi, and T. Kitamura. Proceedings of the 2000 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 3, page 1315-1318. Istanbul, Turkey, (June 2000)
T. Masuko, T. Kobayashi, M. Tamura, J. Masubuchi, and K. Tokuda. Proceedings of the 1998 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 6, page 3745-3748. Seattle, WA, USA, (May 1998)