Giter VIP home page Giter VIP logo

basic-tools's Introduction

常用工具集合 basic-tool

latest version: 1.0-SNAPSHOT

目录

需求背景

共性工具类在日常开发中是非常常见的,如果没有一个统一的外部工具类,势必会在多个项目里存在各种util、utils,代码过于冗余。常见的有

  • date-utils
  • image-utils
  • validate-utils
  • file-utils

对于一些共性的基础工具类是有必要进行收集和融合的,因此,为解决此类问题,开发出依赖少,功能强大,可公用的工具包

功能模块

日期工具类

图片工具类

验证工具类

文件工具类

特性

  • 支持超大文件多线程高速读取,经测试,7min 跑完 3000w+数据(MacOs,硬件配置为:i5处理器 8GB内存 128GB固态)
  • 文件切割可配置化,使用简洁

快速开始

  1. 获取代码 git clone [email protected]:AAA-AA/basic-tools.git
  2. 改造代码,配置大文件路径,设置处理线程数,handle自行处理
public static void main(String[] args) {
        AtomicLong counter = new AtomicLong(0);
        String bigFilePath = "/Users/renhongqiang/Downloads/work-doc/2000W/test.csv";
        BigFileReader.Builder builder = new BigFileReader.Builder(bigFilePath, line -> System.out.println(String.format("total record: %s,line is: %s", counter.incrementAndGet(), line)));
        BigFileReader bigFileReader = builder
                .threadPoolSize(100)
                .charset(StandardCharsets.UTF_8)
                .bufferSize(1024 * 1024).build();
        bigFileReader.start();
}
  1. 执行代码

参考列表

FAQ

basic-tools's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.