After the first part of the series was about reading files in Java, this second part introduces the corresponding methods for writing small and large files. The article addresses the following questions in detail: What is the easiest way to write a string or a list of strings to a text file? How to write
The packages java.io and java.nio.file contain numerous classes for reading and writing files in Java. Since the introduction of the Java NIO.2 (New I/O) File API, it is easy to get lost – not only as a beginner. Since then, you can perform many file operations in several ways. This article series starts by introducing
In the previous article, I showed you that “” + i is the fastest way to convert an int into a String in Java. All the way from Java 7 to Java 14. Today you will learn what to consider in the opposite direction, i.e., when parsing a String to an int. You can find
In this article, I show you how to convert an int into a String in Java the fastest way. The answer is probably surprising for some. I present four variants and measure and compare their speed using JMH microbenchmarks. I analyze the measurement results looking at the Java source code and also the generated bytecode.
In part one of this three-part article series, I showed you how to install and configure Jenkins – and how to create build and release jobs for Maven projects via the Jenkins user interface. In part two, we programmatically created the same jobs with the Jenkins Job DSL and made the job list cleaner using
In the first part of this three-part article series, I showed you how to install and configure Jenkins as Docker containers using Ansible – and how to create build and release jobs for Maven projects using Jenkins’ user interface. In this second part, I show you how to create the same jobs with the Jenkins