Class LibCString


  • public class LibCString
    extends java.lang.Object
    Native bindings to string.h.
    • Method Detail

      • nmemset

        public static long nmemset​(long dest,
                                   int c,
                                   long count)
        Parameters:
        count - number of bytes to fill
      • memset

        public static long memset​(java.nio.ByteBuffer dest,
                                  int c)
        
        public static long memset​(java.nio.ShortBuffer dest,
                                  int c)
        
        public static long memset​(java.nio.IntBuffer dest,
                                  int c)
        
        public static long memset​(java.nio.LongBuffer dest,
                                  int c)
        
        public static long memset​(java.nio.FloatBuffer dest,
                                  int c)
        
        public static long memset​(java.nio.DoubleBuffer dest,
                                  int c)
        
        Fills a memory area with a constant byte.
        Parameters:
        dest - pointer to the memory area to fill
        c - byte to set
        Returns:
        the value of dest
      • memcpy

        public static long memcpy​(java.nio.ByteBuffer dest,
                                  java.nio.ByteBuffer src)
        
        public static long memcpy​(java.nio.ShortBuffer dest,
                                  java.nio.ShortBuffer src)
        
        public static long memcpy​(java.nio.IntBuffer dest,
                                  java.nio.IntBuffer src)
        
        public static long memcpy​(java.nio.LongBuffer dest,
                                  java.nio.LongBuffer src)
        
        public static long memcpy​(java.nio.FloatBuffer dest,
                                  java.nio.FloatBuffer src)
        
        public static long memcpy​(java.nio.DoubleBuffer dest,
                                  java.nio.DoubleBuffer src)
        
        Copies bytes between memory areas that must not overlap.
        Parameters:
        dest - pointer to the destination memory area
        src - pointer to the source memory area
        Returns:
        the value of dest
      • memmove

        public static long memmove​(java.nio.ByteBuffer dest,
                                   java.nio.ByteBuffer src)
        
        public static long memmove​(java.nio.ShortBuffer dest,
                                   java.nio.ShortBuffer src)
        
        public static long memmove​(java.nio.IntBuffer dest,
                                   java.nio.IntBuffer src)
        
        public static long memmove​(java.nio.LongBuffer dest,
                                   java.nio.LongBuffer src)
        
        public static long memmove​(java.nio.FloatBuffer dest,
                                   java.nio.FloatBuffer src)
        
        public static long memmove​(java.nio.DoubleBuffer dest,
                                   java.nio.DoubleBuffer src)
        
        Copies count bytes from memory area src to memory area dest.

        The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.

        Parameters:
        dest - pointer to the destination memory area
        src - pointer to the source memory area
        Returns:
        the value of dest
      • nmemset

        public static long nmemset​(short[] dest,
                                   int c,
                                   long count)
        Array version of: nmemset(long, int, long)
      • nmemset

        public static long nmemset​(float[] dest,
                                   int c,
                                   long count)
        Array version of: nmemset(long, int, long)
      • nmemset

        public static long nmemset​(double[] dest,
                                   int c,
                                   long count)
        Array version of: nmemset(long, int, long)
      • nmemcpy

        public static long nmemcpy​(byte[] dest,
                                   byte[] src,
                                   long count)
        Array version of: nmemcpy(long, long, long)
      • nmemcpy

        public static long nmemcpy​(short[] dest,
                                   short[] src,
                                   long count)
        Array version of: nmemcpy(long, long, long)
      • nmemcpy

        public static long nmemcpy​(long[] dest,
                                   long[] src,
                                   long count)
        Array version of: nmemcpy(long, long, long)
      • nmemcpy

        public static long nmemcpy​(float[] dest,
                                   float[] src,
                                   long count)
        Array version of: nmemcpy(long, long, long)
      • nmemcpy

        public static long nmemcpy​(double[] dest,
                                   double[] src,
                                   long count)
        Array version of: nmemcpy(long, long, long)
      • nmemmove

        public static long nmemmove​(short[] dest,
                                    short[] src,
                                    long count)
        Array version of: nmemmove(long, long, long)
      • nmemmove

        public static long nmemmove​(float[] dest,
                                    float[] src,
                                    long count)
        Array version of: nmemmove(long, long, long)
      • nmemmove

        public static long nmemmove​(double[] dest,
                                    double[] src,
                                    long count)
        Array version of: nmemmove(long, long, long)
      • memset

        public static <T extends CustomBuffer<T>> long memset​(T dest,
                                                              int c)
        Fills memory with a constant byte.
        Parameters:
        dest - pointer to destination
        c - character to set
        Returns:
        the value of dest
      • memcpy

        public static <T extends CustomBuffer<T>> long memcpy​(T dest,
                                                              T src)
        Copies bytes between memory areas that must not overlap.
        Parameters:
        dest - pointer to the destination memory area
        src - pointer to the source memory area
        Returns:
        the value of dest
      • memmove

        public static <T extends CustomBuffer<T>> long memmove​(T dest,
                                                               T src)
        Copies count bytes from memory area src to memory area dest.

        The memory areas may overlap: copying takes place as though the bytes in src are first copied into a temporary array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.

        Parameters:
        dest - pointer to the destination memory area
        src - pointer to the source memory area
        Returns:
        the value of dest