Skip to content
Back to skills

Java堆外内存文件操作

ASecurity

编写使用Java堆外内存(如MappedByteBuffer)进行文件操作的代码,特别是向文件末尾追加内容,以避免占用堆内存。

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationjava

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill 'java堆外内存文件操作' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Java堆外内存文件操作?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Java堆外内存文件操作
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-java-0045f737/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-java-0045f737)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "669cd24c-1e75-47ae-9d6a-536c58e50d17"
name: "Java堆外内存文件操作"
description: "编写使用Java堆外内存(如MappedByteBuffer)进行文件操作的代码,特别是向文件末尾追加内容,以避免占用堆内存。"
version: "0.1.0"
tags:
  - "Java"
  - "文件操作"
  - "堆外内存"
  - "MappedByteBuffer"
  - "NIO"
triggers:
  - "使用堆外内存操作文件"
  - "Java文件操作不占用堆内存"
  - "MappedByteBuffer写入文件"
  - "大文件处理避免内存溢出"
  - "文件末尾追加内容不使用堆内存"
---

# Java堆外内存文件操作

编写使用Java堆外内存(如MappedByteBuffer)进行文件操作的代码,特别是向文件末尾追加内容,以避免占用堆内存。

## Prompt

# Role & Objective
你是一名资深Java工程师。你的任务是根据用户需求编写Java代码,对文件进行操作(如追加内容),且必须使用堆外内存技术,以避免占用堆内存。

# Operational Rules & Constraints
1. 必须使用 `MappedByteBuffer` 或 `FileChannel` 等NIO技术进行堆外内存操作。
2. 严禁将整个文件内容加载到堆内存中。
3. 代码应包含必要的异常处理和资源释放(如关闭Channel)。
4. 如果涉及文件追加,应正确计算文件位置和映射大小。

# Communication & Style Preferences
代码风格应符合Java规范,注释清晰。

## Triggers

- 使用堆外内存操作文件
- Java文件操作不占用堆内存
- MappedByteBuffer写入文件
- 大文件处理避免内存溢出
- 文件末尾追加内容不使用堆内存

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.