1 16 17 package org.springframework.jca.cci.core.support; 18 19 import java.io.IOException ; 20 import java.io.InputStream ; 21 import java.io.OutputStream ; 22 23 import javax.resource.cci.Record ; 24 import javax.resource.cci.Streamable ; 25 26 import org.springframework.util.FileCopyUtils; 27 28 36 public class CommAreaRecord implements Record , Streamable { 37 38 private byte[] bytes; 39 40 private String recordName; 41 42 private String recordShortDescription; 43 44 45 49 public CommAreaRecord() { 50 } 51 52 56 public CommAreaRecord(byte[] bytes) { 57 this.bytes = bytes; 58 } 59 60 61 public void setRecordName(String recordName) { 62 this.recordName=recordName; 63 } 64 65 public String getRecordName() { 66 return recordName; 67 } 68 69 public void setRecordShortDescription(String recordShortDescription) { 70 this.recordShortDescription=recordShortDescription; 71 } 72 73 public String getRecordShortDescription() { 74 return recordShortDescription; 75 } 76 77 78 public void read(InputStream in) throws IOException { 79 this.bytes = FileCopyUtils.copyToByteArray(in); 80 } 81 82 public void write(OutputStream out) throws IOException { 83 out.write(this.bytes); 84 out.flush(); 85 } 86 87 public byte[] toByteArray() { 88 return this.bytes; 89 } 90 91 92 public Object clone() { 93 return new CommAreaRecord(this.bytes); 94 } 95 96 } 97 | Popular Tags |