Skip to Content
EngineUtilsFileUtils

FileUtils

This is a WIP project - Expect breaking changes to occur.

FileUtils currently only contains a method to handle InputStream as a String.

Here’s our implementation below:

public class FileUtils { public static String loadAsString(InputStream stream) throws IOException { try (BufferedReader reader = new BufferedReader( new InputStreamReader(stream, StandardCharsets.UTF_8))) { return reader.lines().collect(Collectors.joining("\n")); } } }

This method is used to load shader files as Strings, which are then passed to the shader program for compilation.

Last updated on