Class FileInputStream

All Implemented Interfaces:
PointerInterface

public class FileInputStream extends InputStream
GFileInputStream provides input streams that take their
content from a file.

GFileInputStream implements #GSeekable, which allows the input
stream to jump to arbitrary positions in the file, provided the
filesystem of the file allows it. To find the position of a file
input stream, use g_seekable_tell(). To find out if a file input
stream supports seeking, use g_seekable_can_seek().
To position a file input stream, use g_seekable_seek().

https://docs.gtk.org/gio/class.FileInputStream.html

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • queryInfo

      public FileInfo queryInfo(@Nonnull Str attributes, @Nullable Cancellable cancellable) throws AllocationError
      Queries a file input stream the given @attributes. This function blocks
      while querying the stream. For the asynchronous (non-blocking) version
      of this function, see g_file_input_stream_query_info_async(). While the
      stream is blocked, the stream will set the pending flag internally, and
      any other operations on the stream will fail with %G_IO_ERROR_PENDING.
      Parameters:
      attributes - a file attribute query string.
      cancellable - optional #GCancellable object, %NULL to ignore.
      Returns:
      a #GFileInfo, or %NULL on error.
      Throws:
      AllocationError
    • queryInfo

      public FileInfo queryInfo(String attributes, @Nullable Cancellable cancellable) throws AllocationError
      Queries a file input stream the given @attributes. This function blocks
      while querying the stream. For the asynchronous (non-blocking) version
      of this function, see g_file_input_stream_query_info_async(). While the
      stream is blocked, the stream will set the pending flag internally, and
      any other operations on the stream will fail with %G_IO_ERROR_PENDING.
      Parameters:
      attributes - a file attribute query string.
      cancellable - optional #GCancellable object, %NULL to ignore.
      Returns:
      a #GFileInfo, or %NULL on error.
      Throws:
      AllocationError
    • queryInfoAsync

      public void queryInfoAsync(@Nonnull Str attributes, int io_priority, @Nullable Cancellable cancellable, FileInputStream.OnAsyncReadyCallback callback, @Nullable Pointer user_data)
      Queries the stream information asynchronously.
      When the operation is finished @callback will be called.
      You can then call g_file_input_stream_query_info_finish()
      to get the result of the operation.

      For the synchronous version of this function,
      see g_file_input_stream_query_info().

      If @cancellable is not %NULL, then the operation can be cancelled by
      triggering the cancellable object from another thread. If the operation
      was cancelled, the error %G_IO_ERROR_CANCELLED will be set
      Parameters:
      attributes - a file attribute query string.
      io_priority - the [I/O priority][io-priority] of the request
      cancellable - optional #GCancellable object, %NULL to ignore.
      callback - callback to call when the request is satisfied
      user_data - the data to pass to callback function
    • queryInfoAsync

      public void queryInfoAsync(String attributes, int io_priority, @Nullable Cancellable cancellable, FileInputStream.OnAsyncReadyCallback callback, @Nullable Pointer user_data)
      Queries the stream information asynchronously.
      When the operation is finished @callback will be called.
      You can then call g_file_input_stream_query_info_finish()
      to get the result of the operation.

      For the synchronous version of this function,
      see g_file_input_stream_query_info().

      If @cancellable is not %NULL, then the operation can be cancelled by
      triggering the cancellable object from another thread. If the operation
      was cancelled, the error %G_IO_ERROR_CANCELLED will be set
      Parameters:
      attributes - a file attribute query string.
      io_priority - the [I/O priority][io-priority] of the request
      cancellable - optional #GCancellable object, %NULL to ignore.
      callback - callback to call when the request is satisfied
      user_data - the data to pass to callback function
    • queryInfoFinish

      public FileInfo queryInfoFinish(@Nonnull AsyncResult result) throws AllocationError
      Finishes an asynchronous info query operation.
      Parameters:
      result - a #GAsyncResult.
      Returns:
      #GFileInfo.
      Throws:
      AllocationError
    • asSeekable

      public Seekable asSeekable()
      Implements interface Seekable. Call this to get access to interface functions.
      Returns:
      Seekable
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()