GW2RegisterInputMemory
GW2RegisterInputMemory 함수는 메모리에 저장된 입력 파일을 세션에 등록합니다.
- C++
- C#
- Java
- Python
- JavaScript
개요
GW2RegisterInputMemory 함수는 크기가 inputLength바이트인 inputFileBuffer가 가리키는 버퍼에 저장된 파일을 session.으로 표시된 세션에 등록합니다.
#include "glasswall.core2.api.h"
int GW2RegisterInputMemory(Session session, const char *inputFileBuffer, size_t inputLength);
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
예제
#include "glasswall.core2.api.h"
...
HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
{
/* ... load file contents into buffer 'buf' and log the file size in 'size' ... */
if (GW2RegisterInputMemory(session, buf, size))
/* deal with error */
else
/* continue processing */
...
}
/* later */
if (GW2CloseSession(session))
/* error closing session */
개요
public int RegisterInputMemory(
int session,
byte[] inputFileBuffer)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
import com.glasswall.core2javabridge.*;
public int GW2RegisterInputMemory(int session, byte[] inputFileBuffer) throws GlasswallException, NullPointerException
public int GW2RegisterInputMemory(int session, byte[] inputFileBuffer, int length) throws GlasswallException, NullPointerException
참고
The length of the inputFileBuffer may optionally be specified.
반환값
GW2RegisterInputMemory 함수는 GW2_RetStatus 열거형을 int로 변환하여 반환합니다. 오류가 발생한 경우 값은 음수가 됩니다. 0은 성공을 나타냅니다. 자세한 내용은 API Overview/Return types를 참조하세요.
GlasswallException 예외는 session이(가) 유효하지 않거나 입력 버퍼를 가져올 수 없는 경우 발생합니다.
NullPointerException 예외는 inputFileBuffer 버퍼가 null이거나 비어 있는 경우 발생합니다.
개요
지정된 세션에 대해 입력 파일 또는 바이트를 등록합니다.
def register_input(self, session: int, input_file: Union[str, bytes, bytearray, io.BytesIO]):
""" Register an input file or bytes for the given session.
Args:
session (int): The session integer.
input_file (Union[str, bytes, bytearray, io.BytesIO]): The input file path or bytes.
Returns:
- result (glasswall.GwReturnObj): Depending on the input 'input_file':
- If input_file is a str file path:
- gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'input_file', 'status'.
- If input_file is a file in memory:
- gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'buffer', 'buffer_length', 'status'.
"""
반환값
input_file의 유형에 따라 서로 다른 속성을 가진 객체입니다.
- If input_file is a str file path:
- gw_return_object (glasswall.GwReturnObj): 'session', 'input_file', 'status' 속성을 가진 GwReturnObj 인스턴스입니다.
- If input_file is a file in memory:
- gw_return_object (glasswall.GwReturnObj): 'session', 'buffer', 'buffer_length', 'status' 속성을 가진 GwReturnObj 인스턴스입니다.
status 속성은 정수 GW2_RetStatus enum 값입니다. 음수는 실패를 나타냅니다.
개요
이 함수는 메모리에 저장된 파일을 지정된 세션의 입력 파일로 등록합니다
/**
* @param {number} session The ID of the session.
* @param {string} inputFileBuffer A buffer holding the file data
* @param {number} inputLength The size of the file buffer
*/
GW2RegisterInputMemory(session, inputFileBuffer, inputLength)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.