Package io.github.jwharm.javagi.gio
Interface AutoCloseable
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
BufferedInputStream
,BufferedOutputStream
,ConverterInputStream
,ConverterOutputStream
,DataInputStream
,DataOutputStream
,FileInputStream
,FileIOStream
,FileOutputStream
,FilterInputStream
,FilterInputStream.FilterInputStreamImpl
,FilterOutputStream
,FilterOutputStream.FilterOutputStreamImpl
,InputStream
,InputStream.InputStreamImpl
,IOStream
,IOStream.IOStreamImpl
,MemoryInputStream
,MemoryOutputStream
,MultipartInputStream
,OutputStream
,OutputStream.OutputStreamImpl
,PollableInputStream.PollableInputStreamImpl
,PollableOutputStream.PollableOutputStreamImpl
,SimpleIOStream
,SocketConnection
,TcpConnection
,TcpWrapperConnection
,TlsClientConnection.TlsClientConnectionImpl
,TlsConnection
,TlsConnection.TlsConnectionImpl
,TlsServerConnection.TlsServerConnectionImpl
,UnixConnection
,UnixInputStream
,UnixOutputStream
,Win32InputStream
,Win32OutputStream
An
AutoCloseable
interface for GIO streams.
This interface extends AutoCloseable
and implements
close()
with a default
method that calls
close(Cancellable)
. This interface is implemented by GIO streams
(IOStream
, InputStream
and OutputStream
) so they
become AutoCloseable
and can be used in a try-with-resources block.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
A default implementation ofAutoCloseable
that callsclose(Cancellable)
.boolean
close
(Cancellable cancellable)
-
Method Details
-
close
A default implementation ofAutoCloseable
that callsclose(Cancellable)
. The return value ofclose(Cancellable)
is ignored.- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
- AnIOException
that is wrapped around theGErrorException
that is thrown byclose(Cancellable)
.
-
close
- Parameters:
cancellable
- optionalCancellable
object,null
to ignore- Returns:
true
on success,false
on failure- Throws:
GErrorException
- SeeGError
-