Module Java.IO

Classes from java.io

Imports

Table of Content

Definitions

data FileNotFoundException = pure native java.io.FileNotFoundException
data UnsupportedEncodingException = pure native java.io.UnsupportedEncodingException
data EOFException = pure native java.io.EOFException

Member Functions

newStringEOFException
pure native new
data OutputStream = native java.io.OutputStream

frege equivalent of java.io.OutputStream

data FileOutputStream = native java.io.FileOutputStream

frege equivalent of java.io.FileOutputStream

Member Functions

newMutableIO FileSTMutable RealWorld FileOutputStream
         throws FileNotFoundException
     | MutableIO FileBoolSTMutable RealWorld FileOutputStream
         throws FileNotFoundException
     | StringSTMutable RealWorld FileOutputStream
         throws FileNotFoundException
     | StringBoolSTMutable RealWorld FileOutputStream
         throws FileNotFoundException
native new
 FileOutputStream.new file true

writes to the end of a file rather than the beginning

new𝖆MutableIO FileSTMutable RealWorld FileOutputStream
native new  throws FileNotFoundException  overloads new
 FileOutputStream.new file true

writes to the end of a file rather than the beginning

new𝖇MutableIO FileBoolSTMutable RealWorld FileOutputStream
native new  throws FileNotFoundException  overloads new
 FileOutputStream.new file true

writes to the end of a file rather than the beginning

new𝖈StringSTMutable RealWorld FileOutputStream
native new  throws FileNotFoundException  overloads new
 FileOutputStream.new file true

writes to the end of a file rather than the beginning

new𝖉StringBoolSTMutable RealWorld FileOutputStream
native new  throws FileNotFoundException  overloads new
 FileOutputStream.new file true

writes to the end of a file rather than the beginning

writeMutableIO FileOutputStreamIntIO ()
native write  throws IOException

Writes the specified byte to this file output stream.

data Closeable = native java.io.Closeable

frege equivalent of java.io.Closeable

Member Functions

closeMutableIO CloseableIO ()
native close  throws IOException
data Flushable = native java.io.Flushable

frege equivalent of java.io.Flushable

Member Functions

flushMutableIO FlushableIO ()
native flush  throws IOException
data URI = pure native java.net.URI

forward declaration of URI

data File = native java.io.File

Member Functions

canReadMutableIO FileIO Bool
native canRead
canWriteMutableIO FileIO Bool
native canWrite
createTempFileStringStringSTMutable RealWorld File
native java.io.File.createTempFile  throws IOException

Create an empty file in the default temp directory.

 createTempFile "abc" ".suffix"

The prefix must be at least 3 characters long!

deleteMutableIO FileIO Bool
native delete
existsMutableIO FileIO Bool
native exists
getNameMutableIO FileIO String
native getName
getParentFileMutableIO FileIO (Maybe (MutableIO File))
native getParentFile
getPathMutableIO FileIO String
native getPath

The (relative) path name. Not necessarily valid.

getPathFFileString
pure native getPath
isAbsoluteMutableIO FileIO Bool
native isAbsolute
isDirectoryMutableIO FileIO Bool
native isDirectory
isFileMutableIO FileIO Bool
native isFile
lastModifiedMutableIO FileIO Long
native lastModified
listMutableIO FileIO (Maybe (ArrayOf RealWorld String))
native list
mkdirsMutableIO FileIO Bool
native mkdirs
newStringSTMutable s File
     | Mutable s FileStringSTMutable s File
native new
new𝖆StringSTMutable s File
native new  overloads new
new𝖇Mutable s FileStringSTMutable s File
native new  overloads new
pathSeparatorString
pure native java.io.File.pathSeparator

Separator for elements of a path, i.e. ":" on Unix

renameToMutableIO FileMutableIO FileIO Bool
native renameTo
separatorString
pure native java.io.File.separator

Separator for elements of a path name, i.e. "/" on Unix

toURIFileURI
pure native toURI
data Writer = native java.io.Writer

Member Functions

putCharMutableIO WriterCharIO ()
writeMutableIO WriterIntIO ()
           throws IOException
       | MutableIO WriterStringIO ()
           throws IOException
       | MutableIO WriterStringIntIntIO ()
           throws IOException
native write
write𝖆MutableIO WriterIntIO ()
native write  throws IOException  overloads write
write𝖇MutableIO WriterStringIO ()
native write  throws IOException  overloads write
write𝖈MutableIO WriterStringIntIntIO ()
native write  throws IOException  overloads write
data OutputStreamWriter = native java.io.OutputStreamWriter

Member Functions

newMutableIO OutputStreamStringSTMutable RealWorld OutputStreamWriter
native new  throws UnsupportedEncodingException
data PrintWriter = native java.io.PrintWriter

Member Functions

newStringSTMutable RealWorld PrintWriter
         throws FileNotFoundException
     | MutableIO FileSTMutable RealWorld PrintWriter
         throws FileNotFoundException
     | MutableIO FileStringSTMutable RealWorld PrintWriter
         throws FileNotFoundException, UnsupportedEncodingException
     | MutableIO WriterSTMutable RealWorld PrintWriter
     | MutableIO WriterBoolSTMutable RealWorld PrintWriter
native new
new𝖆StringSTMutable RealWorld PrintWriter
native new  throws FileNotFoundException  overloads new
new𝖇MutableIO FileSTMutable RealWorld PrintWriter
native new  throws FileNotFoundException  overloads new
new𝖈MutableIO FileStringSTMutable RealWorld PrintWriter
native new  throws FileNotFoundException, UnsupportedEncodingException  overloads new
new𝖉MutableIO WriterSTMutable RealWorld PrintWriter
native new  overloads new
new𝖊MutableIO WriterBoolSTMutable RealWorld PrintWriter
native new  overloads new
printMutableIO PrintWriterStringIO ()
native print

print a String

printfMutableIO PrintWriterString → a → IO ()
        | MutableIO PrintWriterString → a → b → IO ()
        | MutableIO PrintWriterString → a → b → c → IO ()
        | MutableIO PrintWriterString → a → b → c → d → IO ()
        | MutableIO PrintWriterString → a → b → c → d → e → IO ()
        | MutableIO PrintWriterString → a → b → c → d → e → f → IO ()
        | MutableIO PrintWriterString → a → b → c → d → e → f → g → IO ()
        | MutableIO PrintWriterString → a → b → c → d → e → f → g → h → IO ()
        | MutableIO PrintWriterString → a → b → c → d → e → f → g → h → i → IO ()
native printf

format and print 1 to 9 values, see StringJ.format

printf𝖆MutableIO PrintWriterStringaIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printf𝖇MutableIO PrintWriterStringabIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printf𝖈MutableIO PrintWriterStringabcIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printf𝖉MutableIO PrintWriterStringabcdIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printf𝖊MutableIO PrintWriterStringabcdeIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printf𝖋MutableIO PrintWriterStringabcdefIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printf𝖌MutableIO PrintWriterStringabcdefgIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printf𝖍MutableIO PrintWriterStringabcdefghIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printf𝖎MutableIO PrintWriterStringabcdefghiIO ()
native printf  overloads printf

format and print 1 to 9 values, see StringJ.format

printlnMutableIO PrintWriterStringIO ()
         | MutableIO PrintWriterIO ()
native println

print a String followed by a line terminator, or just a line terminator

println𝖆MutableIO PrintWriterStringIO ()
native println  overloads println

print a String followed by a line terminator, or just a line terminator

println𝖇MutableIO PrintWriterIO ()
native println  overloads println

print a String followed by a line terminator, or just a line terminator

stdoutMutableIO PrintWriter
native frege.runtime.Runtime.stdout.get()

nowarn: Don't warn because of constantness

The standard output PrintWriter

stderrMutableIO PrintWriter
native frege.runtime.Runtime.stderr.get()

nowarn: Don't warn because of constantness

The standard error PrintWriter

stdinMutableIO BufferedReader
native frege.runtime.Runtime.stdin.get()

nowarn: Don't warn because of constantness

The standard input BufferedReader

data StringWriter = native java.io.StringWriter

Frege type for a java.io.StringWriter

Not intended for direct use but rather as something a PrintWriter can be made of. (Though, because of the Appendable inheritance, one could still Appendable.append directly.)

To be used like:

 action :: PrintWriter -> IO ()
 action =  ...
 actionOnStringWriter :: IO String
 actionOnStringWriter = do
       sw <- StringWriter.new
       pr <- sw.printer
       action pr
       pr.close
       sw.toString

Member Functions

new()STMutable s StringWriter
native new

create a fresh StringWriter

printerMutableIO StringWriterSTMutable RealWorld PrintWriter

make a PrintWriter that prints to this StringWriter

toStringMutable s StringWriterST s String
native toString

get the content of a StringWriter as String

data InputStream = native java.io.InputStream
data FileInputStream = native java.io.FileInputStream

Member Functions

newMutableIO FileSTMutable RealWorld FileInputStream
         throws FileNotFoundException
     | StringSTMutable RealWorld FileInputStream
         throws FileNotFoundException
native new
new𝖆MutableIO FileSTMutable RealWorld FileInputStream
native new  throws FileNotFoundException  overloads new
new𝖇StringSTMutable RealWorld FileInputStream
native new  throws FileNotFoundException  overloads new
data Reader = native java.io.Reader

Member Functions

getCharMutableIO ReaderIO Char

Read the next character from the input stream. Throws EOFException if the end of the stream has been reached, or IOException if an I/O error occurs.

readMutableIO ReaderIO Int
native read  throws IOException

Reads a single character and returns it as Int in the range 0 to 65535. Returns -1 if the end of the stream has been reached.

Throws IOException if an I/O error occurs.

data InputStreamReader = native java.io.InputStreamReader

Member Functions

newMutableIO InputStreamStringSTMutable RealWorld InputStreamReader
native new  throws UnsupportedEncodingException
data BufferedReader = native java.io.BufferedReader

Member Functions

getLineMutableIO BufferedReaderIO String

Reads the next line from a buffered reader using BufferedReader.readLine, and returns the string or throws EOFException on end of file.

getLinesMutableIO BufferedReaderIO [String]

read all lines and return them as list, close reader afterwards

newMutableIO ReaderSTMutable RealWorld BufferedReader
native new
readLineMutableIO BufferedReaderIO (Maybe String)
native readLine  throws IOException

Reads a line of text. A line is considered to be terminated by any one of a line feed ("\n"), a carriage return ("\r"), or a carriage return followed immediately by a linefeed.

Returns:
Maybe.Just string, where string is the contents of the line, not including any line-termination characters, or Maybe.Nothing if the end of the stream has been reached.
Throws:
IOException - If an I/O error occurs
openReaderStringSTMutable RealWorld BufferedReader

Convenience function to open a file and wrap it with an UTF-8 decoding buffered Reader.

May throw FileNotFoundException

openWriterStringSTMutable RealWorld PrintWriter

Convenience function to open a file for writing through an UTF-8 encoding PrintWriter.

appendWriterStringSTMutable RealWorld PrintWriter

Convenience function to open a file in append mode for writing through an UTF-8 encoding PrintWriter.

May throw FileNotFoundException

Instances

instance Exceptional EOFException

Member Functions

javaClassClass EOFException
pure native java.io.EOFException.class
instance Exceptional FileNotFoundException

Member Functions

javaClassClass FileNotFoundException
pure native java.io.FileNotFoundException.class
instance Exceptional UnsupportedEncodingException

Member Functions

javaClassClass UnsupportedEncodingException
pure native java.io.UnsupportedEncodingException.class
instance Serializable File

Member Functions

copySerializableFileFile
pure native frege.runtime.Runtime.copySerializable

inherited from Serializable.copySerializable

freezeFileFile

inherited from Serializable.freeze

thawFileFile

inherited from Serializable.thaw

instance Show File

Member Functions

displayFileString

inherited from Show.display

showFileString
showCharsFile → [Char]

inherited from Show.showChars

showList[File]StringString

inherited from Show.showList

showsPrecIntFileStringString

inherited from Show.showsPrec

showsubFileString

inherited from Show.showsub

Functions and Values by Type

MutableIO BufferedReaderIO (Maybe String)

BufferedReader.readLine

MutableIO BufferedReaderIO String

BufferedReader.getLine

MutableIO BufferedReaderIO [String]

BufferedReader.getLines

MutableIO CloseableIO ()

Closeable.close

MutableIO FileMutableIO FileIO Bool

File.renameTo

MutableIO FileStringSTMutable RealWorld PrintWriter

PrintWriter.new𝖈

MutableIO FileBoolSTMutable RealWorld FileOutputStream

FileOutputStream.new𝖇

MutableIO FileSTMutable RealWorld FileInputStream

FileInputStream.new𝖆

MutableIO FileSTMutable RealWorld FileOutputStream

FileOutputStream.new𝖆

MutableIO FileSTMutable RealWorld PrintWriter

PrintWriter.new𝖇

MutableIO FileIO (Maybe (ArrayOf RealWorld String))

File.list

MutableIO FileIO (Maybe (MutableIO File))

File.getParentFile

MutableIO FileIO String

File.getPath, File.getName

MutableIO FileIO Bool

File.isFile, File.isAbsolute, File.isDirectory, File.delete, File.exists, File.canRead, File.canWrite, File.mkdirs

MutableIO FileIO Long

File.lastModified

MutableIO FileOutputStreamIntIO ()

FileOutputStream.write

MutableIO FlushableIO ()

Flushable.flush

MutableIO InputStreamStringSTMutable RealWorld InputStreamReader

InputStreamReader.new

MutableIO OutputStreamStringSTMutable RealWorld OutputStreamWriter

OutputStreamWriter.new

MutableIO PrintWriterStringIO ()

PrintWriter.println𝖆, PrintWriter.print

MutableIO PrintWriterIO ()

PrintWriter.println𝖇

MutableIO ReaderSTMutable RealWorld BufferedReader

BufferedReader.new

MutableIO ReaderIO Char

Reader.getChar

MutableIO ReaderIO Int

Reader.read

MutableIO StringWriterSTMutable RealWorld PrintWriter

StringWriter.printer

MutableIO WriterStringIntIntIO ()

Writer.write𝖈

MutableIO WriterStringIO ()

Writer.write𝖇

MutableIO WriterBoolSTMutable RealWorld PrintWriter

PrintWriter.new𝖊

MutableIO WriterCharIO ()

Writer.putChar

MutableIO WriterIntIO ()

Writer.write𝖆

MutableIO WriterSTMutable RealWorld PrintWriter

PrintWriter.new𝖉

StringStringSTMutable RealWorld File

File.createTempFile

StringBoolSTMutable RealWorld FileOutputStream

FileOutputStream.new𝖉

StringSTMutable RealWorld BufferedReader

openReader

StringSTMutable RealWorld FileInputStream

FileInputStream.new𝖇

StringSTMutable RealWorld FileOutputStream

FileOutputStream.new𝖈

StringSTMutable RealWorld PrintWriter

appendWriter, openWriter, PrintWriter.new𝖆

StringEOFException

EOFException.new

[File] → StringString

Show_File.showList

FileString

Show_File.showsub, Show_File.display, Show_File.show, File.getPathF

File → [Char]

Show_File.showChars

FileFile

Serializable_File.thaw, Serializable_File.copySerializable, Serializable_File.freeze

FileURI

File.toURI

IntFileStringString

Show_File.showsPrec

MutableIO BufferedReader

stdin

MutableIO PrintWriter

stderr, stdout

Class EOFException

Exceptional_EOFException.javaClass

Class FileNotFoundException

Exceptional_FileNotFoundException.javaClass

Class UnsupportedEncodingException

Exceptional_UnsupportedEncodingException.javaClass

String

File.separator, File.pathSeparator

MutableIO PrintWriterString → a → IO ()

PrintWriter.printf𝖆

Mutable s FileStringSTMutable s File

File.new𝖇

Mutable s StringWriterST s String

StringWriter.toString

StringSTMutable s File

File.new𝖆

()STMutable s StringWriter

StringWriter.new

ω

File.new, FileInputStream.new, FileOutputStream.new, PrintWriter.println, PrintWriter.new, PrintWriter.printf, Writer.write

MutableIO PrintWriterString → a → b → IO ()

PrintWriter.printf𝖇

MutableIO PrintWriterString → a → b → c → IO ()

PrintWriter.printf𝖈

MutableIO PrintWriterString → a → b → c → d → IO ()

PrintWriter.printf𝖉

MutableIO PrintWriterString → a → b → c → d → e → IO ()

PrintWriter.printf𝖊

MutableIO PrintWriterString → a → b → c → d → e → f → IO ()

PrintWriter.printf𝖋

MutableIO PrintWriterString → a → b → c → d → e → f → g → IO ()

PrintWriter.printf𝖌

MutableIO PrintWriterString → a → b → c → d → e → f → g → h → IO ()

PrintWriter.printf𝖍

MutableIO PrintWriterString → a → b → c → d → e → f → g → h → i → IO ()

PrintWriter.printf𝖎

Valid HTML 4.01 Strict