public SwingDisplay(final byte[] stream,final Map<Object,Object> fonts){
  try {
    this.fonts=fonts;
    final ByteArrayInputStream bis=new ByteArrayInputStream(stream);
    final int version=bis.read();
    if (version != 1) {
      throw new PdfException("Unknown version in serialised object " + version);
    }
    bis.read();
    rawPageNumber=bis.read();
    x_coord=(float[])RenderUtils.restoreFromStream(bis);
    y_coord=(float[])RenderUtils.restoreFromStream(bis);
    text_color=(Vector_Object)RenderUtils.restoreFromStream(bis);
    textFillType=(Vector_Int)RenderUtils.restoreFromStream(bis);
    stroke_color=new Vector_Object();
    stroke_color.restoreFromStream(bis);
    fill_color=new Vector_Object();
    fill_color.restoreFromStream(bis);
    stroke=new Vector_Object();
    stroke.restoreFromStream(bis);
    pageObjects=new Vector_Object();
    pageObjects.restoreFromStream(bis);
    javaObjects=(Vector_Object)RenderUtils.restoreFromStream(bis);
    shapeType=(Vector_Int)RenderUtils.restoreFromStream(bis);
    af1=(Vector_Double)RenderUtils.restoreFromStream(bis);
    af2=(Vector_Double)RenderUtils.restoreFromStream(bis);
    af3=(Vector_Double)RenderUtils.restoreFromStream(bis);
    af4=(Vector_Double)RenderUtils.restoreFromStream(bis);
    clips=new Vector_Shape();
    clips.restoreFromStream(bis);
    objectType=(Vector_Int)RenderUtils.restoreFromStream(bis);
    opacity=(Vector_Float)RenderUtils.restoreFromStream(bis);
    BMvalues=(Vector_Int)RenderUtils.restoreFromStream(bis);
    TRvalues=(Vector_Int)RenderUtils.restoreFromStream(bis);
    fs=(Vector_Int)RenderUtils.restoreFromStream(bis);
    lw=(Vector_Int)RenderUtils.restoreFromStream(bis);
    final int fontCount=(Integer)RenderUtils.restoreFromStream(bis);
    for (int ii=0; ii < fontCount; ii++) {
      final Object key=RenderUtils.restoreFromStream(bis);
      final Object glyphs=RenderUtils.restoreFromStream(bis);
      fonts.put(key,glyphs);
    }
    final int alteredFontCount=(Integer)RenderUtils.restoreFromStream(bis);
    for (int ii=0; ii < alteredFontCount; ii++) {
      final Object key=RenderUtils.restoreFromStream(bis);
      final PdfJavaGlyphs updatedFont=(PdfJavaGlyphs)fonts.get(key);
      updatedFont.setDisplayValues((Map<Integer,String>)RenderUtils.restoreFromStream(bis));
      updatedFont.setCharGlyphs((Map<Integer,String>)RenderUtils.restoreFromStream(bis));
      updatedFont.setEmbeddedEncs((Map<Integer,String>)RenderUtils.restoreFromStream(bis));
    }
    bis.close();
  }
 catch (  final Exception e) {
    LogWriter.writeLog("Exception: " + e.getMessage());
  }
  type=DynamicVectorRenderer.DISPLAY_SCREEN;
  currentItem=pageObjects.get().length;
}

public SwingDisplay ( final byte [ ] stream , final Map < Object , Object > fonts ) { try { this . fonts = fonts ; final ByteArrayInputStream bis = new ByteArrayInputStream ( stream ) ; final int version = bis . read ( ) ; if ( version != 1 ) { throw new PdfException ( "Unknown version in serialised object " + version ) ; } bis . read ( ) ; rawPageNumber = bis . read ( ) ; x_coord = ( float [ ] ) RenderUtils . restoreFromStream ( bis ) ; y_coord = ( float [ ] ) RenderUtils . restoreFromStream ( bis ) ; text_color = ( Vector_Object ) RenderUtils . restoreFromStream ( bis ) ; textFillType = ( Vector_Int ) RenderUtils . restoreFromStream ( bis ) ; stroke_color = new Vector_Object ( ) ; stroke_color . restoreFromStream ( bis ) ; fill_color = new Vector_Object ( ) ; fill_color . restoreFromStream ( bis ) ; stroke = new Vector_Object ( ) ; stroke . restoreFromStream ( bis ) ; pageObjects = new Vector_Object ( ) ; pageObjects . restoreFromStream ( bis ) ; javaObjects = ( Vector_Object ) RenderUtils . restoreFromStream ( bis ) ; shapeType = ( Vector_Int ) RenderUtils . restoreFromStream ( bis ) ; af1 = ( Vector_Double ) RenderUtils . restoreFromStream ( bis ) ; af2 = ( Vector_Double ) RenderUtils . restoreFromStream ( bis ) ; af3 = ( Vector_Double ) RenderUtils . restoreFromStream ( bis ) ; af4 = ( Vector_Double ) RenderUtils . restoreFromStream ( bis ) ; clips = new Vector_Shape ( ) ; clips . restoreFromStream ( bis ) ; objectType = ( Vector_Int ) RenderUtils . restoreFromStream ( bis ) ; opacity = ( Vector_Float ) RenderUtils . restoreFromStream ( bis ) ; BMvalues = ( Vector_Int ) RenderUtils . restoreFromStream ( bis ) ; TRvalues = ( Vector_Int ) RenderUtils . restoreFromStream ( bis ) ; fs = ( Vector_Int ) RenderUtils . restoreFromStream ( bis ) ; lw = ( Vector_Int ) RenderUtils . restoreFromStream ( bis ) ; final int fontCount = ( Integer ) RenderUtils . restoreFromStream ( bis ) ; for ( int ii = 0 ; ii < fontCount ; ii ++ ) { final Object key = RenderUtils . restoreFromStream ( bis ) ; final Object glyphs = RenderUtils . restoreFromStream ( bis ) ; fonts . put ( key , glyphs ) ; } final int alteredFontCount = ( Integer ) RenderUtils . restoreFromStream ( bis ) ; for ( int ii = 0 ; ii < alteredFontCount ; ii ++ ) { final Object key = RenderUtils . restoreFromStream ( bis ) ; final PdfJavaGlyphs updatedFont = ( PdfJavaGlyphs ) fonts . get ( key ) ; updatedFont . setDisplayValues ( ( Map < Integer , String > ) RenderUtils . restoreFromStream ( bis ) ) ; updatedFont . setCharGlyphs ( ( Map < Integer , String > ) RenderUtils . restoreFromStream ( bis ) ) ; updatedFont . setEmbeddedEncs ( ( Map < Integer , String > ) RenderUtils . restoreFromStream ( bis ) ) ; } bis . close ( ) ; } catch ( final Exception e ) { LogWriter . writeLog ( "Exception: " + e . getMessage ( ) ) ; } type = DynamicVectorRenderer . DISPLAY_SCREEN ; currentItem = pageObjects . get ( ) . length ; }
rebuild serialised version not part of api and subject to change ( do not use )
