public class CachedStreamFactory extends Object
Modifier and Type | Class and Description |
---|---|
class |
CachedStreamFactory.MemoryTracker |
Constructor and Description |
---|
CachedStreamFactory(int poolMaxMemory,
int instanceMaxMemory)
Constructor.
|
CachedStreamFactory(int poolMaxMemory,
int instanceMaxMemory,
File cacheDirectory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getInstanceMaxMemory() |
int |
getPoolMaxMemory() |
CachedInputStream |
newInputStream()
Creates an empty input stream.
|
CachedInputStream |
newInputStream(File file) |
CachedInputStream |
newInputStream(InputStream is) |
CachedInputStream |
newInputStream(String content)
Creates a new input stream, assuming UTF-8 content.
|
CachedOutputStream |
newOuputStream() |
CachedOutputStream |
newOuputStream(OutputStream os) |
public CachedStreamFactory(int poolMaxMemory, int instanceMaxMemory)
poolMaxMemory
- maximum number of bytes used for memory caching by
all instances created by this factory combinedinstanceMaxMemory
- maximum number of bytes used for
memory by each cached stream instance createdpublic CachedStreamFactory(int poolMaxMemory, int instanceMaxMemory, File cacheDirectory)
poolMaxMemory
- maximum number of bytes used for memory caching by
all instances created by this factory combinedinstanceMaxMemory
- maximum number of bytes used for
memory by each cached stream instance createdcacheDirectory
- location where file-based caching takes placepublic int getPoolMaxMemory()
public int getInstanceMaxMemory()
public CachedInputStream newInputStream()
public CachedInputStream newInputStream(String content)
content
- content to streampublic CachedInputStream newInputStream(File file)
public CachedInputStream newInputStream(InputStream is)
public CachedOutputStream newOuputStream(OutputStream os)
public CachedOutputStream newOuputStream()
Copyright © 2008–2021 Norconex Inc.. All rights reserved.