Top Description Inners Fields Constructors Methods
org.jooq

public final Class Source

extends Object
Class Inheritance
Static Imports
org.jooq.tools.jdbc.JDBCUtils.safeClose

A source of text data.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final byte[]
private final Charset
private final CharsetDecoder
private final String
private final File
private final InputStream
private final int
private final Reader
private final String

Constructor Summary

AccessConstructor and Description
private
Source(String string, byte[] bytes, String charsetName, Charset charset, CharsetDecoder charsetDecoder, Reader reader, InputStream inputStream, File file, int length)

Method Summary

Modifier and TypeMethod and Description
private final Reader
public static final Source
of(String string)

Create a source from a string.

public static final Source
of(byte[] bytes)

Create a source from binary data.

public static final Source
of(byte[] bytes, String charsetName)

Create a source from binary data using a specific character set.

public static final Source
of(byte[] bytes, Charset charset)

Create a source from binary data using a specific character set.

public static final Source
of(byte[] bytes, CharsetDecoder charsetDecoder)

Create a source from binary data using a specific character set.

public static final Source
of(File file)

Create a source from a file.

public static final Source
of(File file, String charsetName)

Create a source from a file using a specific character set.

public static final Source
of(File file, Charset charset)

Create a source from a file using a specific character set.

public static final Source
of(File file, CharsetDecoder charsetDecoder)

Create a source from a file using a specific character set.

public static final Source
of(Reader reader)

Create a source from a reader.

public static final Source
of(Reader reader, int length)

Create a source from a reader.

public static final Source
of(InputStream inputStream)

Create a source from an input stream.

public static final Source
of(InputStream inputStream, String charsetName)

Create a source from an input stream using a specific character set.

public static final Source
of(InputStream inputStream, Charset charset)

Create a source from an input stream using a specific character set.

public static final Source
of(InputStream inputStream, CharsetDecoder charsetDecoder)

Create a source from an input stream using a specific character set.

public static final Source
of(InputStream inputStream, int length)

Create a source from an input stream.

public static final Source
of(InputStream inputStream, int length, String charsetName)

Create a source from an input stream using a specific character set.

public static final Source
of(InputStream inputStream, int length, Charset charset)

Create a source from an input stream using a specific character set.

public static final Source
of(InputStream inputStream, int length, CharsetDecoder charsetDecoder)

Create a source from an input stream using a specific character set.

public final Reader
reader()

Produce a reader from this source.

public final String
readString()

Read the entire reader() into a String, for convenience.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bytesback to summary
private final byte[] bytes
charsetback to summary
private final Charset charset
charsetDecoderback to summary
private final CharsetDecoder charsetDecoder
charsetNameback to summary
private final String charsetName
fileback to summary
private final File file
inputStreamback to summary
private final InputStream inputStream
lengthback to summary
private final int length
readerback to summary
private final Reader reader
stringback to summary
private final String string

Constructor Detail

Sourceback to summary
private Source(String string, byte[] bytes, String charsetName, Charset charset, CharsetDecoder charsetDecoder, Reader reader, InputStream inputStream, File file, int length)

Method Detail

inputStreamReaderback to summary
private final Reader inputStreamReader(InputStream is) throws UnsupportedEncodingException
ofback to summary
public static final Source of(String string)

Create a source from a string.

ofback to summary
public static final Source of(byte[] bytes)

Create a source from binary data.

ofback to summary
public static final Source of(byte[] bytes, String charsetName)

Create a source from binary data using a specific character set.

ofback to summary
public static final Source of(byte[] bytes, Charset charset)

Create a source from binary data using a specific character set.

ofback to summary
public static final Source of(byte[] bytes, CharsetDecoder charsetDecoder)

Create a source from binary data using a specific character set.

ofback to summary
public static final Source of(File file)

Create a source from a file.

ofback to summary
public static final Source of(File file, String charsetName)

Create a source from a file using a specific character set.

ofback to summary
public static final Source of(File file, Charset charset)

Create a source from a file using a specific character set.

ofback to summary
public static final Source of(File file, CharsetDecoder charsetDecoder)

Create a source from a file using a specific character set.

ofback to summary
public static final Source of(Reader reader)

Create a source from a reader.

ofback to summary
public static final Source of(Reader reader, int length)

Create a source from a reader.

ofback to summary
public static final Source of(InputStream inputStream)

Create a source from an input stream.

ofback to summary
public static final Source of(InputStream inputStream, String charsetName)

Create a source from an input stream using a specific character set.

ofback to summary
public static final Source of(InputStream inputStream, Charset charset)

Create a source from an input stream using a specific character set.

ofback to summary
public static final Source of(InputStream inputStream, CharsetDecoder charsetDecoder)

Create a source from an input stream using a specific character set.

ofback to summary
public static final Source of(InputStream inputStream, int length)

Create a source from an input stream.

ofback to summary
public static final Source of(InputStream inputStream, int length, String charsetName)

Create a source from an input stream using a specific character set.

ofback to summary
public static final Source of(InputStream inputStream, int length, Charset charset)

Create a source from an input stream using a specific character set.

ofback to summary
public static final Source of(InputStream inputStream, int length, CharsetDecoder charsetDecoder)

Create a source from an input stream using a specific character set.

readerback to summary
public final Reader reader() throws IOException

Produce a reader from this source.

Exceptions
IOException:
When something goes wrong creating a reader from this source.
readStringback to summary
public final String readString() throws IOException

Read the entire reader() into a String, for convenience.

Exceptions
IOException:
When something goes wrong creating a reader from this source.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.jooq back to summary

pack-priv Class Source.LengthLimitedInputStream

extends InputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final InputStream
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.
public int
read()

Implements abstract java.io.InputStream.read.

Reads the next byte of data from the input stream.
Inherited from java.io.InputStream:
availablemarkmarkSupportednullInputStreamreadreadreadAllBytesreadNBytesreadNBytesresetskipskipNBytestransferTo

Field Detail

isback to summary
pack-priv final InputStream is
lengthback to summary
pack-priv int length

Constructor Detail

LengthLimitedInputStreamback to summary
pack-priv LengthLimitedInputStream(InputStream is, int length)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.InputStream.close.

Closes this input stream and releases any system resources associated with the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read() throws IOException

Implements abstract java.io.InputStream.read.

Doc from java.io.InputStream.read.

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Returns:int

the next byte of data, or -1 if the end of the stream is reached.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
org.jooq back to summary

pack-priv Class Source.LengthLimitedReader

extends Reader
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv final Reader
Inherited from java.io.Reader:
lock

Constructor Summary

AccessConstructor and Description
pack-priv
LengthLimitedReader(Reader reader, int length)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Closes the stream and releases any system resources associated with it.
public int
read(char[]
Destination buffer
cbuf
,
int
Offset at which to start storing characters
off
,
int
Maximum number of characters to read
len
)

Implements abstract java.io.Reader.read.

Reads characters into a portion of an array.
Inherited from java.io.Reader:
markmarkSupportednullReaderreadreadreadreadyresetskiptransferTo

Field Detail

lengthback to summary
pack-priv int length
readerback to summary
pack-priv final Reader reader

Constructor Detail

LengthLimitedReaderback to summary
pack-priv LengthLimitedReader(Reader reader, int length)

Method Detail

closeback to summary
public void close() throws IOException

Implements abstract java.io.Reader.close.

Implements java.io.Closeable.close.

Doc from java.io.Reader.close.

Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
readback to summary
public int read(char[] cbuf, int off, int len) throws IOException

Implements abstract java.io.Reader.read.

Doc from java.io.Reader.read.

Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

If len is zero, then no characters are read and 0 is returned; otherwise, there is an attempt to read at least one character. If no character is available because the stream is at its end, the value -1 is returned; otherwise, at least one character is read and stored into cbuf.

Parameters
cbuf:char[]

Destination buffer

off:int

Offset at which to start storing characters

len:int

Maximum number of characters to read

Returns:int

The number of characters read, or -1 if the end of the stream has been reached

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs