public final class FileDescriptorSource
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FileDescriptorSource.ProgressCallback |
| Modifier and Type | Field and Description |
|---|---|
private static int |
BUFFER_SIZE |
private java.util.Map<java.lang.String,char[]> |
descriptors |
private static java.lang.String |
ENCODING |
private FileDescriptorSource.ProgressCallback |
progressCallback |
| Constructor and Description |
|---|
FileDescriptorSource() |
| Modifier and Type | Method and Description |
|---|---|
FileDescriptorSource |
addProtoFile(java.lang.String name,
java.io.File protofile) |
FileDescriptorSource |
addProtoFile(java.lang.String name,
java.io.InputStream contents) |
FileDescriptorSource |
addProtoFile(java.lang.String name,
java.io.Reader contents) |
FileDescriptorSource |
addProtoFile(java.lang.String name,
java.lang.String contents) |
FileDescriptorSource |
addProtoFiles(java.lang.ClassLoader userClassLoader,
java.lang.String... classpathResources) |
FileDescriptorSource |
addProtoFiles(java.lang.String... classpathResources) |
static FileDescriptorSource |
fromResources(java.lang.ClassLoader userClassLoader,
java.lang.String... classPathResources) |
static FileDescriptorSource |
fromResources(java.lang.String... classPathResources) |
static FileDescriptorSource |
fromString(java.lang.String name,
java.lang.String protoSource) |
java.util.Map<java.lang.String,char[]> |
getFileDescriptors() |
FileDescriptorSource.ProgressCallback |
getProgressCallback() |
private static java.io.InputStream |
getResourceAsStream(java.lang.ClassLoader userClassLoader,
java.lang.String resourcePath) |
private char[] |
toCharArray(java.io.File file) |
private char[] |
toCharArray(java.io.InputStream is) |
private char[] |
toCharArray(java.io.Reader reader) |
FileDescriptorSource |
withProgressCallback(FileDescriptorSource.ProgressCallback progressCallback) |
private static final java.lang.String ENCODING
private static final int BUFFER_SIZE
private final java.util.Map<java.lang.String,char[]> descriptors
private FileDescriptorSource.ProgressCallback progressCallback
public FileDescriptorSource withProgressCallback(FileDescriptorSource.ProgressCallback progressCallback) throws java.io.IOException
java.io.IOExceptionpublic FileDescriptorSource addProtoFiles(java.lang.String... classpathResources) throws java.io.IOException
java.io.IOExceptionpublic FileDescriptorSource addProtoFiles(java.lang.ClassLoader userClassLoader, java.lang.String... classpathResources) throws java.io.IOException
java.io.IOExceptionpublic FileDescriptorSource addProtoFile(java.lang.String name, java.lang.String contents)
public FileDescriptorSource addProtoFile(java.lang.String name, java.io.InputStream contents) throws java.io.IOException
java.io.IOExceptionpublic FileDescriptorSource addProtoFile(java.lang.String name, java.io.Reader contents) throws java.io.IOException
java.io.IOExceptionpublic FileDescriptorSource addProtoFile(java.lang.String name, java.io.File protofile) throws java.io.IOException
java.io.IOExceptionpublic static FileDescriptorSource fromResources(java.lang.ClassLoader userClassLoader, java.lang.String... classPathResources) throws java.io.IOException
java.io.IOExceptionpublic static FileDescriptorSource fromResources(java.lang.String... classPathResources) throws java.io.IOException
java.io.IOExceptionpublic static FileDescriptorSource fromString(java.lang.String name, java.lang.String protoSource)
public java.util.Map<java.lang.String,char[]> getFileDescriptors()
public FileDescriptorSource.ProgressCallback getProgressCallback()
private char[] toCharArray(java.io.File file)
throws java.io.IOException
java.io.IOExceptionprivate char[] toCharArray(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionprivate char[] toCharArray(java.io.Reader reader)
throws java.io.IOException
java.io.IOExceptionprivate static java.io.InputStream getResourceAsStream(java.lang.ClassLoader userClassLoader,
java.lang.String resourcePath)