cangjie-iostream

Explain Cangjie I/O stream interfaces, buffering, and resource management.

2|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/zhenzhizhi12/NexusAgent --skill cangjie-iostream-zhenzhizhi12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cangjie-iostream
Source: https://github.com/zhenzhizhi12/NexusAgent/tree/main/.opencode/skills/common-skill-l1/iostream
Command: npx skills add https://github.com/zhenzhizhi12/NexusAgent --skill cangjie-iostream-zhenzhizhi12

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to understanding and utilizing Cangjie's Input/Output (I/O) stream models, enabling efficient data handling for various sources.

Core Features & Use Cases

  • I/O Stream Fundamentals: Covers core interfaces like InputStream, OutputStream, IOStream, and Seekable.
  • Memory Buffering: Details the ByteBuffer for in-memory byte stream manipulation.
  • Buffered & String Streams: Explains BufferedInputStream, BufferedOutputStream, StringReader, and StringWriter for enhanced I/O operations.
  • Advanced Stream Types: Introduces ChainedInputStream and MultiOutputStream for complex data flow scenarios.
  • Utility Functions: Highlights helpful functions like copy, readToEnd, and readString.
  • Use Case: When developing applications that read from or write to files, network sockets, or in-memory buffers using Cangjie, this Skill will be essential for correct and efficient implementation.

Quick Start

Use the cangjie-iostream skill to read all data from a byte buffer into a string.

Frequently Asked Questions about cangjie-iostream

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read all data from a ByteBuffer into a string in Cangjie?

To read all data from a ByteBuffer into a string in Cangjie, utilize stream utility functions like `readString` or `readToEnd` provided by the I/O stream programming model for efficient data handling.

Can I use ChainedInputStream and MultiOutputStream for complex data flow in Cangjie?

Yes, Cangjie supports complex data flow scenarios through advanced stream types like `ChainedInputStream` for sequential input processing and `MultiOutputStream` for broadcasting output to multiple destinations.

How does Cangjie handle IOException and ContentFormatException during stream processing?

Cangjie handles stream processing errors by throwing specific exceptions like `IOException` for general input/output failures and `ContentFormatException` for malformed data parsing during I/O operations.

What is the best way to manage resources like standard streams and file sockets in Cangjie?

The best way to manage resources in Cangjie is using the try-with-resource syntax, which ensures automatic closure and cleanup of `InputStream`, `OutputStream`, and standard streams like stdin, stdout, and stderr.

When do I need BufferedInputStream and BufferedOutputStream in Cangjie?

You need `BufferedInputStream` and `BufferedOutputStream` in Cangjie when enhancing I/O operations for performance, reducing direct system calls by buffering data in memory before reading or writing.