/[alph]/alph/org/nongnu/alph/impl/TransientTextScroll.java
ViewVC logotype

Diff of /alph/org/nongnu/alph/impl/TransientTextScroll.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by tjl, Tue Mar 25 14:36:12 2003 UTC revision 1.2 by tjl, Sat Apr 12 06:29:53 2003 UTC
# Line 38  public class TransientTextScroll impleme Line 38  public class TransientTextScroll impleme
38  String rcsid = "$Id$";  String rcsid = "$Id$";
39    
40      boolean finalized = false;      boolean finalized = false;
41      Mediaserver.Id mediaserverId = null;      BlockId mediaserverId = null;
42    
43      final StringBuffer current = new StringBuffer();      final StringBuffer current = new StringBuffer();
44      char[] curchars;      char[] curchars;
# Line 90  String rcsid = "$Id$"; Line 90  String rcsid = "$Id$";
90      }      }
91    
92      public String getID() {      public String getID() {
93          if(mediaserverId != null) return mediaserverId.getString();          if(mediaserverId != null) return mediaserverId.toString();
94          else return "";          else return "";
95      }      }
96    
97      public Mediaserver.Id saveOrGetId(Mediaserver saveTo)      public BlockId saveOrGetId(StormPool saveTo)
98                                  throws java.io.IOException {                                  throws java.io.IOException {
99          if(finalized)          if(finalized)
100              return this.mediaserverId; // saved already              return this.mediaserverId; // saved already
# Line 104  String rcsid = "$Id$"; Line 104  String rcsid = "$Id$";
104    
105          byte[] bytes = current.toString().getBytes("UTF8");          byte[] bytes = current.toString().getBytes("UTF8");
106          String content_type = "text/plain; charset=UTF-8";          String content_type = "text/plain; charset=UTF-8";
107    
108            BlockOutputStream stream = saveTo.getBlockOutputStream(content_type);
109            stream.write(bytes);
110            stream.close();
111    
112          finalized = true;          finalized = true;
113          mediaserverId = saveTo.addDatum(bytes, content_type); //, assocId);          mediaserverId = stream.getBlockId();
114          //id = mediaserverId.getString();  
115          ScrollBlockManager.msCache.put(mediaserverId, this);          ScrollBlockManager.msCache.put(mediaserverId, this);
116          return mediaserverId;          return mediaserverId;
117      }      }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26