zoukankan      html  css  js  c++  java
  • 特殊方式写的文件格式读取到内存(知道用什么内存存的数据用什么内存来接)

    package com;
    
    import java.io.FileInputStream;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.util.Map;
    import java.util.Map.Entry;
    
    public class E {
    
        public static void main(String[] args) throws IOException, ClassNotFoundException {
            String sf = "C:\Users\AOC\ewwq\N2\.mc\mcInfo.mc";
            syccc(sf);
            System.out.println("---------------------------------------");
            sf = "C:\Users\AOC\ewwq\N3\.mc\mcInfo.mc";
            syccc(sf);
        }
    
        public static Map<String, Map<String, String>> syccc(String sf) throws IOException, ClassNotFoundException {
            FileInputStream fin = new FileInputStream(sf);
            ObjectInputStream obs = new ObjectInputStream(fin);
            Map<String, Map<String, String>> map = (Map<String, Map<String, String>>) obs.readObject();
            for (Entry<String, Map<String, String>> mapec : map.entrySet()) {
                System.out.println(mapec.getKey() + "---------------" + mapec.getValue());
            }
            return map;
        }
    }
  • 相关阅读:
    shiro注解,初始化资源和权限,会话管理
    shiro标签
    20个为前端开发者准备的文档和指南
    Canvas处理头像上传
    Chrome 实用调试技巧
    JS 代码编一个倒时器
    sql server优化
    在线图片压缩网站
    Request.QueryString
    C#网络爬虫
  • 原文地址:https://www.cnblogs.com/zhangjiangbin/p/11558448.html
Copyright © 2011-2022 走看看