forked from CinemaMod/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCefPostDataElement_N.java
More file actions
132 lines (115 loc) · 3.44 KB
/
CefPostDataElement_N.java
File metadata and controls
132 lines (115 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
package org.cef.network;
import org.cef.callback.CefNative;
class CefPostDataElement_N extends CefPostDataElement implements CefNative {
// Used internally to store a pointer to the CEF object.
private long N_CefHandle = 0;
@Override
public void setNativeRef(String identifer, long nativeRef) {
N_CefHandle = nativeRef;
}
@Override
public long getNativeRef(String identifer) {
return N_CefHandle;
}
CefPostDataElement_N() {
super();
}
public static CefPostDataElement createNative() {
try {
return CefPostDataElement_N.N_Create();
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
return null;
}
}
@Override
public void dispose() {
try {
N_Dispose(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public boolean isReadOnly() {
try {
return N_IsReadOnly(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public void setToEmpty() {
try {
N_SetToEmpty(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public void setToFile(String fileName) {
try {
N_SetToFile(N_CefHandle, fileName);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public void setToBytes(int size, byte[] bytes) {
try {
N_SetToBytes(N_CefHandle, size, bytes);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public Type getType() {
try {
return N_GetType(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return null;
}
@Override
public String getFile() {
try {
return N_GetFile(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return null;
}
@Override
public int getBytesCount() {
try {
return N_GetBytesCount(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return 0;
}
@Override
public int getBytes(int size, byte[] bytes) {
try {
return N_GetBytes(N_CefHandle, size, bytes);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return 0;
}
private final native static CefPostDataElement_N N_Create();
private final native void N_Dispose(long self);
private final native boolean N_IsReadOnly(long self);
private final native void N_SetToEmpty(long self);
private final native void N_SetToFile(long self, String fileName);
private final native void N_SetToBytes(long self, int size, byte[] bytes);
private final native Type N_GetType(long self);
private final native String N_GetFile(long self);
private final native int N_GetBytesCount(long self);
private final native int N_GetBytes(long self, int size, byte[] bytes);
}