FIND YOUR NEXT FEW LINES

Results for “Java”

Small, practical examples. Search by task or narrow things down below.

257 snippets foundClear filters
JavaEncoding & structured values

Read a big-endian integer from bytes

Java: Set a byte order explicitly when handling a binary protocol.

Java✓ Tested
JavaFile operations & binary data

Read a file length in bytes

Java: Files.size inspects metadata without loading the file into a Java string.

Java✓ Tested
JavaCollections

Read a map with a default

Return a fallback when a Java map does not contain a key.

Java✓ Tested
JavaScriptObjects & JSON

Read a nested value safely

Combine optional chaining with nullish coalescing in JavaScript.

JavaScript✓ Tested
JavaScriptFiles & async

Read a URL query parameter

Parse a URL with the standard JavaScript URL API.

JavaScript✓ Tested
JavaFiles & paths

Read a UTF-8 file

Read a small UTF-8 file into a Java string.

Java✓ Tested
JavaScriptFiles & async

Read a UTF-8 file

Read a small file as text using Node.js.

JavaScript✓ Tested
JavaDates & time zones

Read an ISO week year and week number

Java: Use ISO week fields together because a week can belong to the previous calendar year.

Java✓ Tested
JavaScriptUTC date operations

Read an ISO-style weekday number

JavaScript: Convert Sunday from zero to seven when using Monday-through-Sunday numbering.

JavaScript✓ Tested
JavaScriptObject behavior & collections

Read an object’s own enumerable values

JavaScript: Object.values provides values without their corresponding keys.

JavaScript✓ Tested
JavaScriptUTC date operations

Read date components in UTC

JavaScript: UTC accessors avoid differences caused by the machine’s local timezone.

JavaScript✓ Tested
JavaScriptRegular expressions & URL encoding

Read named regex capture groups

JavaScript: Named groups make a fixed input format easier to inspect than numeric group positions.

JavaScript✓ Tested