use of org.jkiss.dbeaver.ui.editors.binary.BinaryContent in project dbeaver by serge-rider.
the class TextViewDialog method getBinaryContent.
private byte[] getBinaryContent() {
BinaryContent content = hexEditControl.getContent();
ByteBuffer buffer = ByteBuffer.allocate((int) content.length());
try {
content.get(buffer, 0);
} catch (IOException e) {
log.error(e);
}
return buffer.array();
}
use of org.jkiss.dbeaver.ui.editors.binary.BinaryContent in project dbeaver by serge-rider.
the class BinaryPanelEditor method extractEditorValue.
@Override
public void extractEditorValue(@NotNull DBRProgressMonitor monitor, @NotNull HexEditControl control, @NotNull DBDContent value) throws DBException {
BinaryContent binaryContent = control.getContent();
ByteBuffer buffer = ByteBuffer.allocate((int) binaryContent.length());
try {
binaryContent.get(buffer, 0);
} catch (IOException e) {
log.error(e);
}
value.updateContents(monitor, new BytesContentStorage(buffer.array(), GeneralUtils.getDefaultFileEncoding()));
}
Aggregations