|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kde.qt.QIODevice
org.kde.koala.KFilterDev
public class KFilterDev
A class for reading and writing compressed data onto a device (e.g. file, but other usages are possible, like a buffer or a socket). To simply read/write compressed files, see deviceForFile.
Field Summary |
---|
Fields inherited from class org.kde.qt.QIODevice |
---|
IO_AbortError, IO_Append, IO_Async, IO_Combined, IO_ConnectError, IO_Direct, IO_FatalError, IO_ModeMask, IO_Ok, IO_Open, IO_OpenError, IO_Raw, IO_ReadError, IO_ReadOnly, IO_ReadWrite, IO_ResourceError, IO_Sequential, IO_StateMask, IO_TimeOutError, IO_Translate, IO_Truncate, IO_TypeMask, IO_UnspecifiedError, IO_WriteError, IO_WriteOnly |
Constructor Summary | |
---|---|
protected |
KFilterDev(java.lang.Class dummy)
|
|
KFilterDev(KFilterBase filter)
|
|
KFilterDev(KFilterBase filter,
boolean autoDeleteFilterBase)
Constructs a KFilterDev for a given filter (e.g. |
Method Summary | |
---|---|
long |
at()
|
boolean |
at(long arg1)
That one can be quite slow, when going back. |
boolean |
atEnd()
|
void |
close()
Close after reading or writing. |
static org.kde.qt.QIODeviceInterface |
device(org.kde.qt.QIODeviceInterface inDevice,
java.lang.String mimetype)
Creates an i/o device that is able to read from the QIODevice inDevice ,
whether the data is compressed or not. |
static org.kde.qt.QIODeviceInterface |
device(org.kde.qt.QIODeviceInterface inDevice,
java.lang.String mimetype,
boolean autoDeleteInDevice)
Creates an i/o device that is able to read from the QIODevice inDevice ,
whether the data is compressed or not. |
static org.kde.qt.QIODeviceInterface |
deviceForFile(java.lang.String fileName)
|
static org.kde.qt.QIODeviceInterface |
deviceForFile(java.lang.String fileName,
java.lang.String mimetype)
|
static org.kde.qt.QIODeviceInterface |
deviceForFile(java.lang.String fileName,
java.lang.String mimetype,
boolean forceFilter)
Creates an i/o device that is able to read from fileName ,
whether it's compressed or not. |
void |
dispose()
Delete the wrapped C++ instance ahead of finalize() |
protected void |
finalize()
Deletes the wrapped C++ instance |
void |
flush()
|
int |
getch()
|
boolean |
isDisposed()
Has the wrapped C++ instance been deleted? |
boolean |
open(int mode)
Open for reading or writing. |
int |
putch(int arg1)
|
long |
readBlock(java.lang.StringBuffer data,
long maxlen)
|
void |
setOrigFileName(java.lang.String fileName)
For writing gzip compressed files only: set the name of the original file, to be used in the gzip header. |
void |
setSkipHeaders()
Call this let this device skip the gzip headers when reading/writing. |
long |
size()
|
int |
ungetch(int arg1)
|
long |
writeBlock(java.lang.String data,
long len)
|
Methods inherited from class org.kde.qt.QIODevice |
---|
flags, isAsynchronous, isBuffered, isCombinedAccess, isDirectAccess, isInactive, isOpen, isRaw, isReadable, isReadWrite, isSequentialAccess, isSynchronous, isTranslated, isWritable, mode, readAll, readLine, reset, resetStatus, state, status, writeBlock |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected KFilterDev(java.lang.Class dummy)
public KFilterDev(KFilterBase filter, boolean autoDeleteFilterBase)
filter
- the KFilterBase to useautoDeleteFilterBase
- when true this object will become the
owner of filter.
public KFilterDev(KFilterBase filter)
Method Detail |
---|
public boolean open(int mode)
open
in interface org.kde.qt.QIODeviceInterface
open
in class org.kde.qt.QIODevice
public void close()
close
in interface org.kde.qt.QIODeviceInterface
close
in class org.kde.qt.QIODevice
public void flush()
flush
in interface org.kde.qt.QIODeviceInterface
flush
in class org.kde.qt.QIODevice
public void setOrigFileName(java.lang.String fileName)
fileName
- the name of the original filepublic void setSkipHeaders()
public long size()
size
in interface org.kde.qt.QIODeviceInterface
size
in class org.kde.qt.QIODevice
public long at()
at
in interface org.kde.qt.QIODeviceInterface
at
in class org.kde.qt.QIODevice
public boolean at(long arg1)
at
in interface org.kde.qt.QIODeviceInterface
at
in class org.kde.qt.QIODevice
public boolean atEnd()
atEnd
in interface org.kde.qt.QIODeviceInterface
atEnd
in class org.kde.qt.QIODevice
public long readBlock(java.lang.StringBuffer data, long maxlen)
readBlock
in interface org.kde.qt.QIODeviceInterface
readBlock
in class org.kde.qt.QIODevice
public long writeBlock(java.lang.String data, long len)
writeBlock
in interface org.kde.qt.QIODeviceInterface
writeBlock
in class org.kde.qt.QIODevice
public int getch()
getch
in interface org.kde.qt.QIODeviceInterface
getch
in class org.kde.qt.QIODevice
public int putch(int arg1)
putch
in interface org.kde.qt.QIODeviceInterface
putch
in class org.kde.qt.QIODevice
public int ungetch(int arg1)
ungetch
in interface org.kde.qt.QIODeviceInterface
ungetch
in class org.kde.qt.QIODevice
public static org.kde.qt.QIODeviceInterface deviceForFile(java.lang.String fileName, java.lang.String mimetype, boolean forceFilter)
fileName
,
whether it's compressed or not. Available compression filters
(gzip/bzip2 etc.) will automatically be used.
The compression filter to be used is determined from the fileName
if mimetype
is empty. Pass "application/x-gzip" or "application/x-bzip2"
to force the corresponding decompression filter, if available.
Warning: application/x-bzip2 may not be available.
In that case a QFile opened on the compressed data will be returned !
Use KFilterBase.findFilterByMimeType and code similar to what
deviceForFile is doing, to better control what's happening.
The returned QIODevice has to be deleted after using.
fileName
- the name of the file to filtermimetype
- the mime type of the file to filter, or null if unknownforceFilter
- if true, the function will either find a compression filter, or return 0.
If false, it will always return a QIODevice. If no
filter is available it will return a simple QFile.
This can be useful if the file is usable without a filter.
forceFilter.
The returned QIODevice has to be deleted after using.public static org.kde.qt.QIODeviceInterface deviceForFile(java.lang.String fileName, java.lang.String mimetype)
public static org.kde.qt.QIODeviceInterface deviceForFile(java.lang.String fileName)
public static org.kde.qt.QIODeviceInterface device(org.kde.qt.QIODeviceInterface inDevice, java.lang.String mimetype)
inDevice
,
whether the data is compressed or not. Available compression filters
(gzip/bzip2 etc.) will automatically be used.
The compression filter to be used is determined mimetype
.
Pass "application/x-gzip" or "application/x-bzip2"
to use the corresponding decompression filter.
Warning: application/x-bzip2 may not be available.
In that case 0 will be returned !
The returned QIODevice has to be deleted after using.
inDevice
- input device, becomes owned by this device! Automatically deleted!mimetype
- the mime type for the filter
public static org.kde.qt.QIODeviceInterface device(org.kde.qt.QIODeviceInterface inDevice, java.lang.String mimetype, boolean autoDeleteInDevice)
inDevice
,
whether the data is compressed or not. Available compression filters
(gzip/bzip2 etc.) will automatically be used.
The compression filter to be used is determined mimetype
.
Pass "application/x-gzip" or "application/x-bzip2"
to use the corresponding decompression filter.
Warning: application/x-bzip2 may not be available.
In that case 0 will be returned !
The returned QIODevice has to be deleted after using.
inDevice
- input device. Won't be deleted if autoDeleteInDevice
= falsemimetype
- the mime type for the filterautoDeleteInDevice
- if true, inDevice
will be deleted automatically
protected void finalize() throws java.lang.InternalError
finalize
in class java.lang.Object
java.lang.InternalError
public void dispose()
public boolean isDisposed()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |