Class LibCStdio



  • public class LibCStdio
    extends java.lang.Object
    Native bindings to stdio.h.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static long snprintf
      The address of the snprintf function.
      static long sprintf
      The address of the sprintf function.
      static long sscanf
      The address of the sscanf function.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static int vsnprintf(java.nio.ByteBuffer buffer, java.nio.ByteBuffer format, long vlist)
      Loads the data from the locations, defined by vlist, converts them to character string equivalents and writes the results to a character string buffer.
      static int vsnprintf(java.nio.ByteBuffer buffer, java.lang.CharSequence format, long vlist)
      Loads the data from the locations, defined by vlist, converts them to character string equivalents and writes the results to a character string buffer.
      static int vsscanf(java.nio.ByteBuffer buffer, java.nio.ByteBuffer format, long vlist)
      Reads data from the null-terminated character string buffer, interprets it according to format and stores the results into locations defined by vlist.
      static int vsscanf(java.lang.CharSequence buffer, java.lang.CharSequence format, long vlist)
      Reads data from the null-terminated character string buffer, interprets it according to format and stores the results into locations defined by vlist.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sscanf

        The address of the sscanf function.
      • sprintf

        The address of the sprintf function.
      • snprintf

        The address of the snprintf function.
    • Method Detail

      • vsscanf

        public static int vsscanf(java.nio.ByteBuffer buffer,
                                  java.nio.ByteBuffer format,
                                  long vlist)
        
        public static int vsscanf(java.lang.CharSequence buffer,
                                  java.lang.CharSequence format,
                                  long vlist)
        
        Reads data from the null-terminated character string buffer, interprets it according to format and stores the results into locations defined by vlist.
        Parameters:
        buffer - pointer to a null-terminated character string to read from
        format - pointer to a null-terminated character string specifying how to read the input
        vlist - variable argument list containing the receiving arguments
        Returns:
        the number of receiving arguments successfully assigned, or EOF if read failure occurs before the first receiving argument was assigned
      • vsnprintf

        public static int vsnprintf(java.nio.ByteBuffer buffer,
                                    java.nio.ByteBuffer format,
                                    long vlist)
        
        public static int vsnprintf(java.nio.ByteBuffer buffer,
                                    java.lang.CharSequence format,
                                    long vlist)
        
        Loads the data from the locations, defined by vlist, converts them to character string equivalents and writes the results to a character string buffer.
        Parameters:
        buffer - pointer to a character string to write to
        format - pointer to a null-terminated character string specifying how to interpret the data
        vlist - variable argument list containing the data to print
        Returns:
        the number of characters written if successful or negative value if an error occurred. If the resulting string gets truncated due to buf_size limit, function returns the total number of characters (not including the terminating null-byte) which would have been written, if the limit was not imposed.