SerialBlob
SerialBlob (직렬화된 BLOB)
SQL BLOB 값을 Java 프로그래밍 언어로 매핑한 직렬화된 버전입니다.
본문
SerialBlob 클래스는 Blob 객체에서 인스턴스를 만드는 생성자를 제공합니다. Blob 객체에서 SerialBlob을 만들기 전에 그 Blob 객체가 SQL BLOB 값의 데이터를 클라이언트로 가져와 있어야 합니다. SQL BLOB 값의 데이터는 Blob.getBytes 메서드로 클라이언트에서 바이트 배열로, 또는 Blob.getBinaryStream 메서드로 해석되지 않은 바이트 스트림으로 구체화할 수 있어요.
SerialBlob 메서드는 SerialBlob 객체를 바이트 배열이나 스트림으로 복사하고, 주어진 바이트 패턴이나 Blob 객체를 SerialBlob 내에서 찾으며, Blob 객체를 갱신하거나 잘라내는 것을 가능하게 합니다.
SerialBlob은 여러 동시 스레드가 사용하기에 안전하지 않습니다. 둘 이상의 스레드가 사용한다면 적절한 동기화로 접근을 제어해야 해요.
public SerialBlob(byte[] b) throws SerialException, SQLException
public SerialBlob(Blob blob) throws SerialException, SQLException
public byte[] getBytes(long pos, int length) throws SerialException
public long length() throws SerialException
public InputStream getBinaryStream() throws SerialException
public InputStream getBinaryStream(long pos, long length) throws SerialException
public long position(byte[] pattern, long start) throws SerialException, SQLException
public long position(Blob pattern, long start) throws SerialException, SQLException
public void setBytes(long pos, byte[] bytes) throws SerialException
public int setBytes(long pos, byte[] bytes, int offset, int length) throws SerialException
public void truncate(long len) throws SerialException
truncate는 지정한 길이만큼 BLOB 데이터를 잘라냅니다.