APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.javafx.runtime.async

public abstract Class AbstractRemoteResource<T>

extends AbstractAsyncOperation<T>
Class Inheritance
Known Direct Subclasses
com.sun.javafx.tk.quantum.PrismImageLoader2.AsyncImageLoader
Imports
java.io.BufferedInputStream, .IOException, .InputStream, .InterruptedIOException, java.util.Objects

Abstract base class for representing remote resources identified by a URL. Subclasses may plug in arbitrary post-processing on the stream to turn it into the desired result. Manages progress indication if the remote resource provides a content-length header.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
public static record
public static interface
AbstractRemoteResource.SizedStreamSupplier

An interface to provide a stream with a known (or unknown) size that allows IOException to be thrown.

Field Summary

Modifier and TypeField and Description
private final AbstractRemoteResource.SizedStreamSupplier
Inherited from com.sun.javafx.runtime.async.AbstractAsyncOperation:
futurelistener

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public T
call()

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

protected abstract T
Inherited from com.sun.javafx.runtime.async.AbstractAsyncOperation:
addProgresscancelgetProgressGranularitygetProgressMaxisCancelledisDonenotifyProgresssetProgressGranularitysetProgressMaxstart

Field Detail

sizedStreamSupplierback to summary
private final AbstractRemoteResource.SizedStreamSupplier sizedStreamSupplier

Constructor Detail

AbstractRemoteResourceback to summary
protected AbstractRemoteResource(AbstractRemoteResource.SizedStreamSupplier sizedStreamSupplier, AsyncOperationListener<T> listener)

Method Detail

callback to summary
public T call() throws IOException

Implements java.util.concurrent.Callable.call.

Doc from java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

Annotations
@Override
processStreamback to summary
protected abstract T processStream(InputStream stream)
com.sun.javafx.runtime.async back to summary

protected Class AbstractRemoteResource.ProgressInputStream

extends BufferedInputStream
Class Inheritance

Field Summary

Inherited from java.io.BufferedInputStream:
bufcountmarklimitmarkpospos

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized int
read()

Overrides java.io.BufferedInputStream.read.

See the general contract of the read method of InputStream.

public synchronized int
read(byte[] b, int off, int len)

Overrides java.io.BufferedInputStream.read.

Reads bytes from this byte-input stream into the specified byte array, starting at the given offset.

public int
read(byte[] b)

Overrides java.io.FilterInputStream.read.

Reads up to b.length bytes of data from this input stream into an array of bytes.

Inherited from java.io.BufferedInputStream:
availableclosemarkmarkSupportedresetskiptransferTo

Constructor Detail

ProgressInputStreamback to summary
public ProgressInputStream(InputStream in)

Method Detail

readback to summary
public synchronized int read() throws IOException

Overrides java.io.BufferedInputStream.read.

Doc from java.io.BufferedInputStream.read.

See the general contract of the read method of InputStream.

Annotations
@Override
Exceptions
IOException:
if this input stream has been closed by invoking its close() method, or an I/O error occurs.
readback to summary
public synchronized int read(byte[] b, int off, int len) throws IOException

Overrides java.io.BufferedInputStream.read.

Doc from java.io.BufferedInputStream.read.

Reads bytes from this byte-input stream into the specified byte array, starting at the given offset.

This method implements the general contract of the corresponding read method of the InputStream class. As an additional convenience, it attempts to read as many bytes as possible by repeatedly invoking the read method of the underlying stream. This iterated read continues until one of the following conditions becomes true:

  • The specified number of bytes have been read,
  • The read method of the underlying stream returns -1, indicating end-of-file, or
  • The available method of the underlying stream returns zero, indicating that further input requests would block.
If the first read on the underlying stream returns -1 to indicate end-of-file then this method returns -1. Otherwise, this method returns the number of bytes actually read.

Subclasses of this class are encouraged, but not required, to attempt to read as many bytes as possible in the same fashion.

Annotations
@Override
Exceptions
IOException:
if this input stream has been closed by invoking its close() method, or an I/O error occurs.
readback to summary
public int read(byte[] b) throws IOException

Overrides java.io.FilterInputStream.read.

Doc from java.io.FilterInputStream.read.

Reads up to b.length bytes of data from this input stream into an array of bytes. This method blocks until some input is available.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
com.sun.javafx.runtime.async back to summary

public final Record AbstractRemoteResource.SizedStream

extends Record
Class Inheritance
Record Components
stream:InputStream
an InputStream, cannot be null
size:long
the size of the stream, or -1 if unknown

Field Summary

Modifier and TypeField and Description
private final long
size

Record Component accessed by size().

the size of the stream, or -1 if unknown
private final InputStream
stream

Record Component accessed by stream().

an InputStream, cannot be null

Constructor Summary

AccessConstructor and Description
public
SizedStream(InputStream stream, long size)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public long
size()

Record Component getter of size.

Record Component the size of the stream, or -1 if unknown

public InputStream
stream()

Record Component getter of stream.

Record Component an InputStream, cannot be null

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

sizeback to summary
private final long size

Record Component accessed by size().

the size of the stream, or -1 if unknown

streamback to summary
private final InputStream stream

Record Component accessed by stream().

an InputStream, cannot be null

Constructor Detail

SizedStreamback to summary
public SizedStream(InputStream stream, long size)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

sizeback to summary
public long size()

Record Component getter of size.

Record Component
the size of the stream, or -1 if unknown
streamback to summary
public InputStream stream()

Record Component getter of stream.

Record Component
an InputStream, cannot be null
toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

com.sun.javafx.runtime.async back to summary

public Interface AbstractRemoteResource.SizedStreamSupplier


An interface to provide a stream with a known (or unknown) size that allows IOException to be thrown.

Method Summary

Modifier and TypeMethod and Description
public AbstractRemoteResource.SizedStream
get()

Method Detail

getback to summary
public AbstractRemoteResource.SizedStream get() throws IOException