FIND YOUR NEXT FEW LINES

Results for “read-only”

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

990 snippets foundClear filters
RustParsing & byte data

Read a little-endian integer from bytes

Read a little-endian integer from bytes in a complete Rust program using the standard library.

Rust✓ Tested
JavaCollections

Read a map with a default

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

Java✓ Tested
GoHTTP & URLs

Read a named request cookie

Read a named request cookie using a complete Go program with explicit sample inputs.

Go✓ Tested
GitTags & repository configuration

Read a repository-specific configuration value

Git: The local scope makes configuration lookup predictable for this practice repository.

Git✓ Tested
PythonFiles & paths

Read a text file

Open a UTF-8 text file and read its contents. A context manager closes the file automatically, even if reading fails.

file✓ Tested
C#Files & paths

Read a text file

Load a small text file into a C# string.

C#✓ Tested
GoHTTP & URLs

Read a URL’s host and path

Read a URL’s host and path using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaFiles & paths

Read a UTF-8 file

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

Java✓ Tested
GitTags & repository configuration

Read an annotated tag’s message

Git: for-each-ref can inspect annotation contents without including a commit diff.

Git✓ Tested
GoHTTP & URLs

Read an HTTP query parameter

Read an HTTP query parameter using a complete Go program with explicit sample inputs.

Go✓ Tested
C#JSON & binary formats

Read an optional JSON property safely

C#: Use TryGetProperty instead of throwing when an optional property is absent.

C#✓ Tested
RustFiles & paths

Read buffered lines from a file

Read buffered lines from a file in a complete Rust program using the standard library.

Rust✓ Tested