diff options
Diffstat (limited to 'sax/source/tools/converter.cxx')
-rw-r--r-- | sax/source/tools/converter.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index 8ee00c63be1f..b73aef090e13 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -2439,6 +2439,21 @@ bool Converter::convertAny(OUStringBuffer& rsValue, return bConverted; } +void Converter::convertBytesToHexBinary(OUStringBuffer& rBuffer, const void* pBytes, + sal_Int32 nBytes) +{ + rBuffer.setLength(0); + rBuffer.ensureCapacity(nBytes * 2); + auto pChars = static_cast<const unsigned char*>(pBytes); + for (sal_Int32 i = 0; i < nBytes; ++i) + { + sal_Int32 c = *pChars++; + if (c < 16) + rBuffer.append('0'); + rBuffer.append(c, 16); + } +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |