상세 컨텐츠

본문 제목

오라클 BLOB TYPE 데이터를 Byte[]로 저장

C#

by xarfox 2011. 3. 26. 22:56

본문


BLOB bLOB= (BLOB)pkContents.get("BINARY_DATA";
InputStream inStream = null;
ByteArrayOutputStream outStream = null;

byte[] recvData = null;

try
{
byte[] buf = new byte[1024];
inSteam = bLOB.getBinarySteam();
outStream = new ByteArrayOutputStream();

int readCnt = 0;
while( (readCnt = inStream.read(buf)) != -1 )
{
outStream.write(buf,0,readCnt);
}

outStream.flush();

recvData = outStream.toByteArry();

Debug.WriteLine(recvData.Length);

관련글 더보기