2 * Copyright (c) 2007 Yahoo! Inc. All rights reserved.
3 * See accompanying LICENSE file.
5 package com
.yahoo
.pig
.data
;
7 import java
.io
.BufferedOutputStream
;
8 import java
.io
.DataOutputStream
;
10 import java
.io
.FileOutputStream
;
11 import java
.io
.IOException
;
12 import java
.util
.Iterator
;
15 public class DataBagFileWriter
{
19 public DataBagFileWriter(File store
) throws IOException
{
21 out
= new DataOutputStream(new BufferedOutputStream(new FileOutputStream(store
)));
24 public void write(Tuple t
) throws IOException
{
28 public void write(Iterator
<Tuple
> iter
) throws IOException
{
29 while (iter
.hasNext())
30 iter
.next().write(out
);
33 public void close() throws IOException
{
38 public void flush() throws IOException
{