diff options
author | fred ross-perry <fredross-perry@Fred-Ross-Perrys-Computer.local> | 2016-07-14 16:05:15 -0700 |
---|---|---|
committer | fred ross-perry <fred.ross-perry@artifex.com> | 2016-07-15 09:36:56 -0700 |
commit | cb78b5c6782f14a699f90bd5621cd3656a1e02ea (patch) | |
tree | 47b83072ff5fb133f8d4ac9ff32992e464234f86 /platform/java/src/com/artifex/mupdf/fitz/Buffer.java | |
parent | e47769cf2bc9feb30c074c965883f9662540ab3b (diff) | |
download | mupdf-cb78b5c6782f14a699f90bd5621cd3656a1e02ea.tar.xz |
java - move fitz sources into a 'src' subfolder.
Diffstat (limited to 'platform/java/src/com/artifex/mupdf/fitz/Buffer.java')
-rw-r--r-- | platform/java/src/com/artifex/mupdf/fitz/Buffer.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/platform/java/src/com/artifex/mupdf/fitz/Buffer.java b/platform/java/src/com/artifex/mupdf/fitz/Buffer.java new file mode 100644 index 00000000..7f23b062 --- /dev/null +++ b/platform/java/src/com/artifex/mupdf/fitz/Buffer.java @@ -0,0 +1,39 @@ +package com.artifex.mupdf.fitz; + +public class Buffer +{ + static { + Context.init(); + } + + public static final int DEFAULT_BUFFER_SIZE = 1024; + + private long pointer; + + protected native void finalize(); + + public void destroy() { + finalize(); + pointer = 0; + } + + private native long newNativeBuffer(int n); + + public Buffer(int n) { + pointer = newNativeBuffer(n); + } + + public Buffer() { + pointer = newNativeBuffer(DEFAULT_BUFFER_SIZE); + } + + public native int getLength(); + public native void writeByte(byte b); + public native void writeBytes(byte[] bs); + public native void writeBuffer(Buffer buf); + public native void writeRune(int rune); + public native void writeLine(String line); + public native void writeLines(String... lines); + + public native void save(String filename); +} |