//Auto-generated by kalyptus. DO NOT EDIT.
#include <qglobal.h>
#include <qbuffer.h>
#include <qiodevice.h>
#include <qcstring.h>

#include <qtjava/QtSupport.h>
#include <qtjava/QBuffer.h>

class QBufferJBridge : public QBuffer
{
public:
	QBufferJBridge() : QBuffer() {};
	QBufferJBridge(QByteArray arg1) : QBuffer(arg1) {};
	~QBufferJBridge() {QtSupport::qtKeyDeleted(this);}
};

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QBuffer_at__(JNIEnv* env, jobject obj)
{
	jlong xret = (jlong) ((QBuffer*) QtSupport::getQt(env, obj))->at();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QBuffer_at__J(JNIEnv* env, jobject obj, jlong arg1)
{
	jboolean xret = (jboolean) ((QBuffer*) QtSupport::getQt(env, obj))->at((QIODevice::Offset) arg1);
	return xret;
}

JNIEXPORT jbyteArray JNICALL
Java_org_kde_qt_QBuffer_buffer(JNIEnv* env, jobject obj)
{
	QByteArray _qbyteArray;
	_qbyteArray = ((QBuffer*) QtSupport::getQt(env, obj))->buffer();
	return QtSupport::fromQByteArray(env, &_qbyteArray);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBuffer_close(JNIEnv* env, jobject obj)
{
	((QBuffer*) QtSupport::getQt(env, obj))->close();
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBuffer_dispose(JNIEnv* env, jobject obj)
{
	Java_org_kde_qt_QBuffer_finalize(env, obj);
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBuffer_finalize(JNIEnv* env, jobject obj)
{
	if (QtSupport::allocatedInJavaWorld(env, obj)) {
		delete (QBuffer*)QtSupport::getQt(env, obj);
		QtSupport::setQt(env, obj, 0);
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBuffer_flush(JNIEnv* env, jobject obj)
{
	((QBuffer*) QtSupport::getQt(env, obj))->flush();
	return;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QBuffer_getch(JNIEnv* env, jobject obj)
{
	jint xret = (jint) ((QBuffer*) QtSupport::getQt(env, obj))->getch();
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QBuffer_isDisposed(JNIEnv* env, jobject obj)
{
	return (QtSupport::getQt(env, obj) == 0);
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBuffer_newQBuffer__(JNIEnv* env, jobject obj)
{
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBufferJBridge());
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT void JNICALL
Java_org_kde_qt_QBuffer_newQBuffer___3B(JNIEnv* env, jobject obj, jbyteArray arg1)
{
static QByteArray* _qbyteArray_arg1 = 0;
	if (QtSupport::getQt(env, obj) == 0) {
		QtSupport::setQt(env, obj, new QBufferJBridge((QByteArray)*(QByteArray*) QtSupport::toQByteArray(env, arg1, &_qbyteArray_arg1)));
		QtSupport::setObjectForQtKey(env, obj, QtSupport::getQt(env, obj));
	}
	return;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QBuffer_open(JNIEnv* env, jobject obj, jint arg1)
{
	jboolean xret = (jboolean) ((QBuffer*) QtSupport::getQt(env, obj))->open((int) arg1);
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QBuffer_putch(JNIEnv* env, jobject obj, jint arg1)
{
	jint xret = (jint) ((QBuffer*) QtSupport::getQt(env, obj))->putch((int) arg1);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QBuffer_readBlock(JNIEnv* env, jobject obj, jobject p, jlong arg2)
{
static QCString* _qstring_p = 0;
	if (_qstring_p == 0) { _qstring_p = new QCString(); }
	_qstring_p->resize((uint) arg2);
	jlong xret = (jlong) ((QBuffer*) QtSupport::getQt(env, obj))->readBlock((char*) _qstring_p->data(), (Q_ULONG) arg2);
	QtSupport::fromQCStringToStringBuffer(env, _qstring_p, p);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QBuffer_readLine(JNIEnv* env, jobject obj, jstring p, jlong arg2)
{
static QCString* _qstring_p = 0;
	jlong xret = (jlong) ((QBuffer*) QtSupport::getQt(env, obj))->readLine((char*) QtSupport::toCharString(env, p, &_qstring_p), (Q_ULONG) arg2);
	return xret;
}

JNIEXPORT jboolean JNICALL
Java_org_kde_qt_QBuffer_setBuffer(JNIEnv* env, jobject obj, jbyteArray arg1)
{
static QByteArray* _qbyteArray_arg1 = 0;
	jboolean xret = (jboolean) ((QBuffer*) QtSupport::getQt(env, obj))->setBuffer((QByteArray)*(QByteArray*) QtSupport::toQByteArray(env, arg1, &_qbyteArray_arg1));
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QBuffer_size(JNIEnv* env, jobject obj)
{
	jlong xret = (jlong) ((QBuffer*) QtSupport::getQt(env, obj))->size();
	return xret;
}

JNIEXPORT jint JNICALL
Java_org_kde_qt_QBuffer_ungetch(JNIEnv* env, jobject obj, jint arg1)
{
	jint xret = (jint) ((QBuffer*) QtSupport::getQt(env, obj))->ungetch((int) arg1);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QBuffer_writeBlock__Ljava_lang_String_2J(JNIEnv* env, jobject obj, jstring p, jlong arg2)
{
static QCString* _qstring_p = 0;
	jlong xret = (jlong) ((QBuffer*) QtSupport::getQt(env, obj))->writeBlock((const char*) QtSupport::toCharString(env, p, &_qstring_p), (Q_ULONG) arg2);
	return xret;
}

JNIEXPORT jlong JNICALL
Java_org_kde_qt_QBuffer_writeBlock___3B(JNIEnv* env, jobject obj, jbyteArray data)
{
static QByteArray* _qbyteArray_data = 0;
	jlong xret = (jlong) ((QBuffer*) QtSupport::getQt(env, obj))->writeBlock((const QByteArray&)*(QByteArray*) QtSupport::toQByteArray(env, data, &_qbyteArray_data));
	return xret;
}

