模块 mxlib.api

类 Toolkit.IO

  • 封闭类:
    Toolkit

    public static class Toolkit.IO
    extends Object
    IO 数据操作
    从以下版本开始:
    2.5
    • 构造器详细资料

      • IO

        public IO()
    • 方法详细资料

      • writeTo

        public static long writeTo​(@NotNull
                                   @NotNull InputStream is,
                                   @NotNull
                                   @NotNull OutputStream os,
                                   @Nullable
                                   @org.jetbrains.annotations.Nullable byte[] buffer,
                                   long length)
                            throws IOException
        抛出:
        IOException
      • toBytes

        public static byte[] toBytes​(int bits,
                                     int bytes)
        get bytes from bits
        参数:
        bits - Bits of cut
        bytes - byte array size
        返回:
        The array of bits
        从以下版本开始:
        2.7
        另请参阅:
        toBytes(long, int)
      • toBytes

        public static byte[] toBytes​(long bits,
                                     int bytes)
        get bytes from bits
        参数:
        bits - Bits of cut
        bytes - byte array size
        返回:
        The array of bits
        从以下版本开始:
        2.7
      • insertData

        public static void insertData​(long position,
                                      ByteBuffer data,
                                      @NotNull
                                      @NotNull RandomAccessFile access)
                               throws IOException
        Insert data to file
        参数:
        position - The insert position
        data - The data insert
        access - The random access file.(writable and readable)
        抛出:
        IOException - The runtime exception.
        从以下版本开始:
        2.7
      • insertData

        public static void insertData​(long position,
                                      ByteBuffer data,
                                      @NotNull
                                      @NotNull RandomAccessFile access,
                                      boolean raw)
                               throws IOException
        Insert data to file
        参数:
        position - The insert position
        data - The data insert
        access - The random access file.(writable and readable)
        raw - Set write all data.(Unsafe)
        抛出:
        IOException - The runtime exception.
        从以下版本开始:
        2.7
      • insertEmpty

        public static void insertEmpty​(long position,
                                       int size,
                                       @NotNull
                                       @NotNull RandomAccessFile access)
                                throws IOException
        Insert empty data to position
        参数:
        position - The insert position
        size - The empty size
        access - The random access file.(writable and readable)
        抛出:
        IOException - The runtime exception.
        从以下版本开始:
        2.7
      • digest

        public static byte[] digest​(@NotNull
                                    @NotNull MessageDigest md,
                                    @NotNull
                                    @NotNull File file)
                             throws IOException
        Quick calculation of file/directory
        参数:
        md - The meddage digest
        file - The file or dir
        返回:
        the digest
        抛出:
        IOException - Throw when make any exception.
        从以下版本开始:
        2.11
      • digest

        public static byte[] digest​(@NotNull
                                    @NotNull MessageDigest md,
                                    @NotNull
                                    @NotNull Supplier<? extends InputStream> data,
                                    @Nullable
                                    @org.jetbrains.annotations.Nullable byte[] buffer)
                             throws IOException
        Quick calculation of input streams.
        参数:
        md - The message digest using.
        data - Streams.
        buffer - reading buffer.
        返回:
        Result
        抛出:
        IOException - Stream Reading Error.