乐于分享
好东西不私藏

Java IO与NIO深入源码解析

Java IO与NIO深入源码解析

深入理解Java IO机制,从容应对面试与实战

一、BIO源码解析

1.1 IO流层次结构

1┌─────────────────────────────────────────────────────────────────────┐2│                      Java IO流层次结构图                              │3├─────────────────────────────────────────────────────────────────────┤4│                                                                     │5│                        ┌──────────────┐                             │6│                        │   InputStream │                            │7│                        └───────┬──────┘                             │8│                    ┌───────────┴───────────┐                       │9│                    │                       │                         │10│            ┌───────┴───────┐     ┌───────┴───────┐               │11│            │ FileInputStream│     │FilterInputStream│              │12│            │ SocketInput   │     │ BufferedInput   │              │13│            └───────────────┘     └────────────────┘               │14│                                                                     │15│                        ┌──────────────┐                             │16│                        │  OutputStream │                            │17│                        └───────┬──────┘                             │18│                    ┌───────────┴───────────┐                       │19│                    │                       │                         │20│            ┌───────┴───────┐     ┌───────┴───────┐               │21│            │FileOutputStream│     │FilterOutput   │                │22│            └───────────────┘     └────────────────┘               │23│                                                                     │24│                        ┌──────────────┐                             │25│                        │    Reader     │                            │26│                        └───────┬──────┘                             │27│                    ┌───────────┴───────────┐                       │28│            ┌───────┴───────┐     ┌───────┴───────┐               │29│            │  FileReader   │     │ BufferedReader │               │30│            └───────────────┘     └────────────────┘               │31│                                                                     │32└─────────────────────────────────────────────────────────────────────┘

1.2 FileInputStream源码解析

java1/**2 * FileInputStream 源码解析3 * 4 * 继承关系:5 * FileInputStream -> InputStream -> Object6 */7publicclass FileInputStream extends InputStream {89    // 文件描述符10privatefinal FileDescriptor fd;1112    // 文件路径13privatefinalString path;1415    // 通道16private FileChannel channel;1718    // 私有属性19privateboolean closed = false;2021    /**22     * 构造方法23     */24publicFileInputStream(String name) throws FileNotFoundException {25this(name != null ? newFile(name) : null);26    }2728publicFileInputStream(File file) throws FileNotFoundException {29String name = (file != null ? file.getPath() : null);30        SecurityManager security = System.getSecurityManager();31if (security != null) {32            security.checkRead(name);33        }34if (name == null) {35thrownewNullPointerException();36        }37if (file.isInvalid()) {38thrownewFileNotFoundException("Invalid file path");39        }40this.fd = newFileDescriptor();41this.path = name;42        // 打开文件,native方法43open(name);44    }4546    /**47     * 打开文件 - native方法48     */49privatenativevoidopen(String name) throws FileNotFoundException;5051    /**52     * 读取字节53     */54publicintread() throws IOException {55        // 同步56synchronized (this) {57ensureOpen();58        }59        // native读取60returnread0();61    }6263    // native方法64privatenativeintread0() throws IOException;6566    /**67     * 读取到字节数组68     */69publicintread(byte[] b, int off, int len) throws IOException {70synchronized (this) {71ensureOpen();72            // 核心读取逻辑73returnreadBytes(b, off, len);74        }75    }7677privatenativeintreadBytes(byte[] b, int off, int len) throws IOException;7879    /**80     * 获取FileChannel81     */82public FileChannel getChannel() {83synchronized (this) {84if (channel == null) {85                channel = FileChannelImpl.open(fd, path, truefalsethis);86            }87return channel;88        }89    }9091    /**92     * 关闭流93     */94publicvoidclose() throws IOException {95synchronized (this) {96if (closed) {97return;98            }99            closed = true;100        }101102if (channel != null) {103            channel.close();104        }105106        // native关闭107close0();108    }109110privatenativevoidclose0() throws IOException;111}

1.3 Buffer缓存机制

java1/**2 * Buffer 源码解析3 * 4 * Buffer是一个有限容量的容器,用于存储特定基本类型的数据5 */6publicabstractclass Buffer {78    // Buffer属性9privatelong address;      // 内存地址10privateint capacity;      // 容量11privateint limit;         // 限制12privateint position;       // 位置13privateint mark;          // 标记1415    // 构造方法16Buffer(int mark, int pos, int lim, int cap, long addr) {17if (cap < 0)18thrownewIllegalArgumentException("Negative capacity: " + cap);19this.capacity = cap;20limit(lim);21position(pos);22if (mark >= 0) {23if (mark > pos)24thrownewIllegalArgumentException("mark > position: ("25                        + mark + " > " + pos + ")");26this.mark = mark;27        } else {28this.mark = -1;29        }30this.address = addr;31    }3233    /**34     * 获取位置35     */36publicfinalintposition() {37return position;38    }3940    /**41     * 设置位置42     */43publicfinal Buffer position(int newPosition) {44if (newPosition > limit || newPosition < 0)45thrownewIllegalArgumentException();46        position = newPosition;47if (mark > position) mark = -1;48returnthis;49    }5051    /**52     * 获取限制53     */54publicfinalintlimit() {55return limit;56    }5758    /**59     * 设置限制60     */61publicfinal Buffer limit(int newLimit) {62if (newLimit > capacity || newLimit < 0)63thrownewIllegalArgumentException();64        limit = newLimit;65if (position > limit) position = limit;66if (mark > limit) mark = -1;67returnthis;68    }6970    /**71     * 切换到读模式72     */73publicfinal Buffer flip() {74        limit = position;75        position = 0;76        mark = -1;77returnthis;78    }7980    /**81     * 切换到写模式82     */83publicfinal Buffer clear() {84        position = 0;85        limit = capacity;86        mark = -1;87returnthis;88    }8990    /**91     * 标记当前位置92     */93publicfinal Buffer mark() {94        mark = position;95returnthis;96    }9798    /**99     * 回到标记位置100     */101publicfinal Buffer reset() {102int m = mark;103if (m < 0)104thrownewInvalidMarkException();105        position = m;106returnthis;107    }108}

二、NIO核心源码

2.1 Channel通道

java1/**2 * Channel 接口 - NIO核心3 * 4 * Channel表示一个打开的连接,可以进行IO操作5 */6publicinterface Channel extends Closeable {78    // 判断通道是否打开9publicbooleanisOpen();1011    // 关闭通道12publicvoidclose() throws IOException;13}1415/**16 * FileChannel 实现17 */18publicabstractclass FileChannel extends AbstractInterruptibleChannel19implements SeekableByteChannel, GatheringByteChannel, ScatteringByteChannel {2021    // 成员变量22protectedfinal FileDescriptor fd;23privatefinalString path;2425    /**26     * 读取数据到Buffer27     */28publicintread(ByteBuffer dst) throws IOException {29synchronized (this) {30ensureOpen();31returnreadInternal(dst, -1);32        }33    }3435privateintreadInternal(ByteBuffer dst, long position) throws IOException {36        // 省略实现细节...37int n = 0;38try {39begin();40            n = -1;41            // 调用native方法42            n = readInternal0(position, dst, dst.position(), dst.limit() - dst.position());43if (n > 0) {44                dst.position(dst.position() + n);45            }46        } finally {47end(n > 0);48        }49return n;50    }5152    // native方法53privatenativeintreadInternal0(long position, ByteBuffer bb, int offset, int length) throws IOException;5455    /**56     * 写入数据57     */58publicintwrite(ByteBuffer src) throws IOException {59synchronized (this) {60ensureOpen();61returnwriteInternal(src, -1);62        }63    }6465    /**66     * 传输数据到另一个Channel67     */68publiclongtransferTo(long position, long count, WritableByteChannel target)69throws IOException70    {71if (!target.isOpen())72thrownewClosedChannelException();73if (!isOpen())74thrownewClosedChannelException();75if (!readable)76thrownewNonReadableChannelException();7778long n = -1;79try {80begin();81            n = transferTo0(position, count, target);82        } finally {83end(n > 0);84        }85return n;86    }8788    // native方法89privatenativelongtransferTo0(long position, long count, WritableByteChannel target)90throws IOException;91}

2.2 Selector选择器

java1/**2 * Selector 源码解析3 * 4 * Selector是IO多路复用的核心,用于监控多个Channel的状态5 */6publicabstractclass Selector implements Closeable {78    // 成员变量9protectedSet<SelectionKey> keys;           // 注册的key10privateSet<SelectionKey> selectedKeys;     // 已选择的key11privatevolatileint wakeupSocket;          // 唤醒标记1213    /**14     * 打开Selector15     */16publicstatic Selector open() throws IOException {17return SelectorProvider.provider().openSelector();18    }1920    /**21     * 选择就绪的Channel22     */23publicintselect() throws IOException {24returnselect(0);25    }2627    /**28     * 带超时的选择29     */30publicintselect(long timeout) throws IOException {31if (timeout < 0)32thrownewIllegalArgumentException("Negative timeout");33returnlockAndDoSelect(timeout == 0 ? -1 : timeout);34    }3536privateintlockAndDoSelect(long timeout) throws IOException {37synchronized (this) {38ensureOpen();39returndoSelect(timeout);40        }41    }4243    /**44     * 实际的选择操作 - abstract方法45     */46protectedabstractintdoSelect(long timeout) throws IOException;4748    /**49     * 立即返回的选择50     */51publicintselectNow() throws IOException {52returnselect(0);53    }5455    /**56     * 唤醒Selector57     */58public Selector wakeup() {59        // 唤醒阻塞的select60        wakeupSocket = 1;61returnthis;62    }63}6465/**66 * SelectionKey67 * 68 * 表示一个Channel注册到Selector上的状态69 */70publicabstractclass SelectionKey {7172    // 就绪操作73publicstaticfinalint OP_READ = 1 << 0;      // 0001 = 174publicstaticfinalint OP_WRITE = 1 << 2;     // 0100 = 475publicstaticfinalint OP_CONNECT = 1 << 3;   // 1000 = 876publicstaticfinalint OP_ACCEPT = 1 << 4;    // 0001 0000 = 167778    // 成员变量79privatevolatileint interestOps;      // 关注操作80privateint readyOps;                  // 就绪操作8182    /**83     * 获取Channel84     */85publicabstract SelectableChannel channel();8687    /**88     * 获取Selector89     */90publicabstract Selector selector();9192    /**93     * 设置关注操作94     */95public SelectionKey interestOps(int ops) {96checkValid();97returninterestOps0(ops);98    }99100    /**101     * 获取就绪操作102     */103publicintreadyOps() {104checkValid();105return readyOps;106    }107108    /**109     * 判断是否可读110     */111publicfinalbooleanisReadable() {112return (readyOps() & OP_READ) != 0;113    }114115    /**116     * 判断是否可写117     */118publicfinalbooleanisWritable() {119return (readyOps() & OP_WRITE) != 0;120    }121}

三、IO模型对比

3.1 BIO vs NIO vs AIO

java1/**2 * IO模型对比示例3 */45// BIO - 阻塞IO6publicclass BIOServer {7publicvoidhandle() throws IOException {8        ServerSocket serverSocket = newServerSocket(8080);9while (true) {10            // 阻塞:等待连接11            Socket client = serverSocket.accept();12            // 为每个客户端创建新线程13newThread(() -> {14try {15                    // 阻塞:等待数据16                    BufferedReader reader = newBufferedReader(17newInputStreamReader(client.getInputStream()));18String line;19while ((line = reader.readLine()) != null) {20                        // 处理数据21                    }22                } catch (IOException e) {23                    e.printStackTrace();24                }25            }).start();26        }27    }28}2930// NIO - 非阻塞IO31publicclass NIOServer {32publicvoidhandle() throws IOException {33        Selector selector = Selector.open();34        ServerSocketChannel server = ServerSocketChannel.open();35        server.configureBlocking(false);36        server.register(selector, SelectionKey.OP_ACCEPT);3738while (true) {39            // 阻塞:等待事件40            selector.select();4142Set<SelectionKey> keys = selector.selectedKeys();43for (SelectionKey key : keys) {44if (key.isAcceptable()) {45                    // 接受连接46                    ServerSocketChannel ssc = (ServerSocketChannel) key.channel();47                    SocketChannel sc = ssc.accept();48                    sc.configureBlocking(false);49                    sc.register(selector, SelectionKey.OP_READ);50                } elseif (key.isReadable()) {51                    // 读取数据52                    SocketChannel sc = (SocketChannel) key.channel();53                    ByteBuffer buffer = ByteBuffer.allocate(1024);54                    sc.read(buffer);55                }56            }57        }58    }59}

3.2 零拷贝实现

java1/**2 * 零拷贝技术3 * 4 * 传统IO:4次拷贝5 * 1. 磁盘 -> 内核缓冲区6 * 2. 内核缓冲区 -> 用户空间7 * 3. 用户空间 -> Socket缓冲区8 * 4. Socket缓冲区 -> 网卡9 * 10 * 零拷贝:2次拷贝11 * 1. 磁盘 -> 内核缓冲区12 * 2. 内核缓冲区 -> 网卡13 */14publicclass ZeroCopyDemo {1516    /**17     * FileChannel.transferTo 实现18     */19publicvoidtransferTo(FileInputStream source, FileOutputStream dest) 20throws IOException {2122        FileChannel fromChannel = source.getChannel();23        FileChannel toChannel = dest.getChannel();2425        // 使用零拷贝26long position = 0;27long size = fromChannel.size();2829        // 循环传输大文件30while (position < size) {31long transferred = fromChannel.transferTo(32                position, 33                size - position, 34                toChannel35            );36            position += transferred;37        }38    }3940    /**41     * sendfile系统调用42     */43publicvoidsendfile() throws IOException {44        // Linux sendfile(int out_fd, int in_fd, off_t *offset, size_t count)45        // 在内核空间直接完成数据传输46    }47}

四、实战优化

4.1 Buffer池化

java1/**2 * Buffer池化实现3 */4publicclass BufferPool {56    // 池大小7privatestaticfinalint POOL_SIZE = 64;89    // ByteBuffer池10privatestaticfinal ConcurrentLinkedQueue<ByteBuffer> POOL = 11new ConcurrentLinkedQueue<>();1213static {14        // 初始化池15for (int i = 0; i < POOL_SIZE; i++) {16            POOL.offer(ByteBuffer.allocateDirect(8192));17        }18    }1920    /**21     * 获取Buffer22     */23publicstatic ByteBuffer acquire() {24        ByteBuffer buffer = POOL.poll();25if (buffer == null) {26            // 池为空,创建新Buffer27return ByteBuffer.allocateDirect(8192);28        }29        // 清除Buffer30        buffer.clear();31return buffer;32    }3334    /**35     * 归还Buffer36     */37publicstaticvoidrelease(ByteBuffer buffer) {38if (buffer != null && POOL.size() < POOL_SIZE) {39            buffer.clear();40            POOL.offer(buffer);41        }42    }43}4445/**46 * 使用示例47 */48publicclass NIOServer {49publicvoidhandle() {50        ByteBuffer buffer = BufferPool.acquire();51try {52            channel.read(buffer);53            // 处理数据54        } finally {55            BufferPool.release(buffer);56        }57    }58}

4.2 分散读取与聚合写入

java1/**2 * Scatter/Gather IO3 * 4 * 分散读取:将数据读取到多个Buffer5 * 聚合写入:将多个Buffer的数据写入到同一位置6 */7publicclass ScatterGatherDemo {89    /**10     * 分散读取11     */12publicvoidscatterRead(FileChannel channel) throws IOException {13        // 创建多个Buffer14        ByteBuffer header = ByteBuffer.allocate(128);15        ByteBuffer body = ByteBuffer.allocate(1024);1617        // 分散读取18        ByteBuffer[] buffers = { header, body };19long bytesRead = channel.read(buffers);2021        // 处理数据22        header.flip();23        body.flip();2425while (header.hasRemaining()) {26            System.out.print((char) header.get());27        }28    }2930    /**31     * 聚合写入32     */33publicvoidgatherWrite(FileChannel channel) throws IOException {34        ByteBuffer header = ByteBuffer.allocate(128);35        ByteBuffer body = ByteBuffer.allocate(1024);3637        // 写入数据38        header.put("Header Data".getBytes());39        body.put("Body Data".getBytes());4041        // 聚合写入42        ByteBuffer[] buffers = { header, body };43        channel.write(buffers);44    }45}

总结

1┌─────────────────────────────────────────────────────────────────────┐2│                    Java IO与NIO要点总结                               │3├─────────────────────────────────────────────────────────────────────┤4│                                                                     │5│   📖 BIO源码                                                       │6│   └── InputStream / OutputStream / FileReader                     │7│                                                                     │8│   🔄 NIO核心                                                        │9│   └── Channel / Buffer / Selector                                  │10│                                                                     │11│   ⚡ IO模型对比                                                    │12│   └── BIO / NIO / AIO                                             │13│                                                                     │14│   🚀 零拷贝                                                        │15│   └── transferTo / sendfile                                       │16│                                                                     │17│   💡 性能优化                                                      │18│   └── Buffer池 / Scatter/Gather                                    │19│                                                                     │20└─────────────────────────────────────────────────────────────────────┘

🚀 加入「军军程序学堂」,掌握更多Java IO与NIO实战技巧!

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-06-02 06:57:08 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/692944.html
  2. 运行时间 : 0.147599s [ 吞吐率:6.78req/s ] 内存消耗:4,941.44kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=c61bdb9efb1592311b71726e30d689a1
  1. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_static.php ( 6.05 KB )
  7. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/ralouphie/getallheaders/src/getallheaders.php ( 1.60 KB )
  10. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  11. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  12. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  13. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  14. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  15. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  16. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  17. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  18. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  19. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions_include.php ( 0.16 KB )
  21. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions.php ( 5.54 KB )
  22. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  23. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  24. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  25. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/provider.php ( 0.19 KB )
  26. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  27. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  28. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  29. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/common.php ( 0.03 KB )
  30. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  32. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/alipay.php ( 3.59 KB )
  33. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  34. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/app.php ( 0.95 KB )
  35. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cache.php ( 0.78 KB )
  36. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/console.php ( 0.23 KB )
  37. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cookie.php ( 0.56 KB )
  38. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/database.php ( 2.48 KB )
  39. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/filesystem.php ( 0.61 KB )
  40. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/lang.php ( 0.91 KB )
  41. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/log.php ( 1.35 KB )
  42. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/middleware.php ( 0.19 KB )
  43. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/route.php ( 1.89 KB )
  44. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/session.php ( 0.57 KB )
  45. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/trace.php ( 0.34 KB )
  46. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/view.php ( 0.82 KB )
  47. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/event.php ( 0.25 KB )
  48. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  49. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/service.php ( 0.13 KB )
  50. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/AppService.php ( 0.26 KB )
  51. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  52. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  53. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  54. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  55. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  56. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/services.php ( 0.14 KB )
  57. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  58. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  59. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  60. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  61. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  62. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  63. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  64. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  65. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  66. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  67. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  68. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  69. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  70. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  71. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  72. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  73. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  74. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  75. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  76. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  77. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  78. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  79. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  80. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  81. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  82. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  83. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  84. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  85. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  86. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  87. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/Request.php ( 0.09 KB )
  88. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  89. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/middleware.php ( 0.25 KB )
  90. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  91. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  92. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  93. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  94. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  95. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  96. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  97. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  98. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  99. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  100. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  101. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  102. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  103. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/route/app.php ( 3.94 KB )
  104. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  105. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  106. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Index.php ( 9.87 KB )
  108. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/BaseController.php ( 2.05 KB )
  109. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  110. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  111. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  112. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  113. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  114. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  115. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  116. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  117. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  118. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  119. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  120. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  121. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  122. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  123. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  124. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  125. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  126. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  127. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  128. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  129. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  130. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  131. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  132. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  133. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  134. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  135. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Es.php ( 3.30 KB )
  136. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  137. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  138. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  139. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  140. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  141. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  142. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  143. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  144. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/runtime/temp/c935550e3e8a3a4c27dd94e439343fdf.php ( 31.50 KB )
  145. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001042s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001860s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000800s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000707s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001473s ]
  6. SELECT * FROM `set` [ RunTime:0.000575s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001661s ]
  8. SELECT * FROM `article` WHERE `id` = 692944 LIMIT 1 [ RunTime:0.001414s ]
  9. UPDATE `article` SET `lasttime` = 1780354628 WHERE `id` = 692944 [ RunTime:0.005027s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000649s ]
  11. SELECT * FROM `article` WHERE `id` < 692944 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001046s ]
  12. SELECT * FROM `article` WHERE `id` > 692944 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000921s ]
  13. SELECT * FROM `article` WHERE `id` < 692944 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001588s ]
  14. SELECT * FROM `article` WHERE `id` < 692944 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.008688s ]
  15. SELECT * FROM `article` WHERE `id` < 692944 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.015514s ]
0.151695s