/** Returns the contents of this objects serialized as a byte array. */ public byte[] toByteArray() { if (byteInfo != null) { return byteInfo; } try { HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT); toData(hdos); byteInfo = hdos.toByteArray(); return byteInfo; } catch (IOException e) { throw new InternalGemFireError(LocalizedStrings.MemberAttributes_IOEXCEPTION_ON_A_BYTE_ARRAY_0.toLocalizedString(e)); } }