Skip to content

API Reference

Groundbreaking edited this page Aug 29, 2025 · 1 revision

API Reference

Fission Class

Static Methods

  • readString(String path) - Read file as string (UTF-8)
  • readString(Path path, Charset charset) - Read with custom charset
  • readLines(String path) - Read all lines
  • chars(Path path) - Create file character source
  • chars(String content) - Create string character source

CharSource Interface

Core Methods

  • read() - Read next character
  • peek() - Peek next character
  • hasNext() - Check if more characters
  • mark()/reset()/commit() - Position management

Utility Methods

  • readWhile(Predicate) - Read while condition true
  • readUntil(int) - Read until delimiter
  • readLine() - Read line (handles \n and \r\n)
  • skipWhitespace() - Skip whitespace characters
  • startsWith(String) - Check prefix
  • consume(String) - Consume if matches

Implementations

  • StringCharSource - In-memory string source
  • FileCharSource - File-based source (implements ClosableCharSource)

Clone this wiki locally