Java 类net.minecraft.server.RegionFileCache 实例源码

项目:redismine    文件:RegionFileCacheTest.java   
@Test
public void roundTrip() throws Exception {
    File worldDir = new File(WORLD_PATH);
    try (DataOutputStream outputStream = RegionFileCache.openChunkForWriting(worldDir, X, Z)) {
        outputStream.writeUTF(CHUNK_CONTENT);
    }
    try (DataInputStream inputStream = RegionFileCache.openChunkForReading(worldDir, X, Z)) {
        String readBack = inputStream.readUTF();
        assertEquals(CHUNK_CONTENT, readBack);
    }
}